Printscreen Problem - Second Post
I cannot figure this one out so any suggestions are
appreciated.
Am trying to print an image of the screen. Thought
it would be simple -- use Print. All I get is a blank
sheet of paper. If I use GetFormImage and print that,
I also get a blank. I can save GetFormImage to the
clipboard and it pastes OK. If I check the size of the
bitmap before I print it, the size is correct. What am
I doing wrong here? Thanks.
I tried the following code as a replacement for just Print.
var
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
try
Bmp.Assign(GetFormImage);
with Printer do
begin
BeginDoc;
Canvas.Draw((PageWidth - Bmp.Width) div 2,
(PageHeight - Bmp.Height) div 2,
Bmp);
EndDoc;
end;
finally
Bmp.Free;
end; //Print;