Solved

Form Image including TitleBar

Posted on 2003-11-12
11
325 Views
Last Modified: 2013-11-18
Hi Friends

I want to take the image of an invisible Form.

I have tried it using GetFormImage and PaintTo
But this all gives only the image of the client area. But i want to get the image including title bar Like we use Alt + PrintScreen

Thanks


Cheers
0
Comment
Question by:Bijith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
11 Comments
 
LVL 4

Expert Comment

by:kabix
ID: 9735566
you want to make a screen shot of a program or what? Please explain more...
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 50 total points
ID: 9736996
If it is invisible, you can't get an image of it.
0
 
LVL 3

Author Comment

by:Bijith
ID: 9737469
Thanks for your comments

kabix,

Yes, I want to get the image of the form. similar to screenshort.


 EddieShipman,

Using GetFormImage,  PaintTo you can take the image of the form. But  it have only the image of clientarea(Excluding titlebar and border).

But I want the image of complete form

thanks


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:EddieShipman
ID: 9738938
Like I said...
"If it is invisible, you can't get an image of it."
0
 
LVL 3

Author Comment

by:Bijith
ID: 9739368
EddieShipman,

Using  GetFormImage,  PaintTo  you can take the image of windows client area

thanks
0
 
LVL 4

Expert Comment

by:kabix
ID: 9740279
Is the form invisible or you can see it? Because if the form is invisible you can not take a screen shot of it like you do with printscreen
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9741089
Here is your solution even thought it won't work on an INVISIBLE window.
Like I said before, YOU CAN NOT GET AN IMAGE OF AN INVISIBLE FORM.


  function GetWindowBitmap(hWindow:hWnd):HBitmap;
  var
    DC,MemDC:HDC;
    bmWidth,bmHeight:Integer;
    TR:tRect;
    bm,obm:HBitmap;
  begin
    // full window bitmap
    GetWindowRect(hWindow,TR);
    { note the +1 }
    bmWidth:=TR.Right-TR.Left+1;
    bmHeight:=TR.Bottom-TR.Top+1;
    // Full Screen DC
    DC:=GetDC(0);
    MemDC:=CreateCompatibleDC(DC);

    bm:=CreateCompatibleBitmap(DC,bmWidth,bmHeight);
    // now select the bitmap to memDC
    obm:=SelectObject(MemDC,bm);
    // and copy the window

    BitBlt(MemDC,0,0,bmWidth,bmHeight,DC,tr.left,tr.top,SRCCOPY);
    // clean up
    SelectObject(MemDC,obm);
    DeleteDC(MemDC);
    ReleaseDC(hWindow,DC);
    // here is your bitmap
    GetWindowBitmap:=bm;
  end;
0
 
LVL 3

Author Comment

by:Bijith
ID: 9745548
Screen is invisible

EddieShipman,

Thanks for your code. But this is not what i required, This was what my program was doing previously. But now i want to take the image in another way.

Also You are still holding on the point that "YOU CAN NOT GET AN IMAGE OF AN INVISIBLE FORM."

But now i am getting the image of the client area of the invisible form.
I am using PaintTo method. I will supply a deveice context to it . So it will contain the image of the client area and the controls inside client area.


regards
Bijith
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 12754198
But as you said, you use PaintTo and it does only clientarea of the form.
You are going to have to live with that or make your form visible to get caption.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LAN or WAN ? 11 105
How to get statistic's from a competitors website?! 1 124
I want to use librsync in my Delphi backup application. 3 69
Delphi problems to abort a printjob 9 34
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question