Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Take a picture of a window without showing it out

Status
Not open for further replies.

JPattom

Programmer
Aug 8, 2003
7
IN
Hi Experts

I want to take the bitmap picture of a window without showing it, I am using the below code but its only giving the client area, but I want get te whole window as if we are doing Alt + PrintScreen (Take a picture of it while it is active possible but i want it without showing the window) i just want to pass a Form to the procedure and get its picture

procedure PaintWinControl(WinControl:TWinConTrol);
var
lBitMap: TBitmap;
begin
lBitMap := TBitmap.Create;
lBitMap.Width := 0;
lBitMap.Height := 0;
lBitmap.Width := WinControl.Width;
lBitmap.Height := WinControl.Height;
try
WinControl.PaintTo(lBitmap.Canvas.Handle,0,0);
lBitMap.SaveToFile('C:\FormPicture.bmp');
finally
lBitMap.Free;
end;
end;

Pls anybody do help me to sort it out

Hopefully
JPattom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top