Thanks, but the question wasnt how to take a screenshot. And.. I got an error using your solution:
procedure TForm1.Button1Click(Sender: TObject);
var
MyBitmap: TBitmap;
ScreenDC: HDC;
begin
MyBitmap := TBitmap.Create(self);
ScreenDC := GetDC(0);
MyBitmap.LoadFromDevice(ScreenDC);
ReleaseDC(ScreenDC);
end;
It says:
unit1.pas(39,23) Error: Unknown record field identifier "CREATE"
unit1.pas(41,12) Error: Unknown record field identifier "LOADFROMDEVICE"
unit1.pas(42,21) Error: Wrong number of parameters specified for call to "ReleaseDC"
unit1.pas(58) Fatal: There were 3 errors compiling module, stopping
But how do I SAVE the image in the Clipboard to my computer?
Whats wrong with
Image1.Picture.Assign(ClipBoard);
??
Thanks.
Pascal