Solved

Form Image including TitleBar

Posted on 2003-11-12
11
326 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
Graphics32 under Delphi 10.1 Berlin 2 183
PHP preg_replace code convert to Delphi 14 98
DBCtrlGrid, Delphi, Scroll 8 86
DBCtrlGrid, Delphi, Scroll 7 35
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 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