Answer the question
In order to leave comments, you need to log in
How to take a screenshot in Delphi, process (colors), crop and paste into a picture on a form without saving to a file?
How to take a screenshot in Delphi, process (colors), crop and paste into a picture on a form without saving to a file?
Answer the question
In order to leave comments, you need to log in
The screenshot is done like this.
procedure TForm1.Button1Click(Sender: TObject);
var
bmp:TBitmap;
begin
bmp := TBitmap.Create;
try
bmp.PixelFormat := pf32bit; // сейчас не нужно, но, вероятно, потребуется при обработке
bmp.Width := Screen.Width;
bmp.Height := Screen.Height;
BitBlt(bmp.Canvas.Handle, 0,0, Screen.Width, Screen.Height,
GetDC(0), 0,0,SRCCOPY);
imgScreen.Picture.Assign(bmp); // теста ради выведем на Image; в боевой проге не нужно
finally
bmp.Free;
end;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question