Mega Code Archive

 
Categories / Delphi / Graphic
 

How to get a form as bitmap and copy it into the clipboard save it to a file

Title: How to get a form as bitmap and copy it into the clipboard/ save it to a file procedure TForm1.Button1Click(Sender: TObject); var imgWindow: TBitmap; begin imgWindow := GetFormImage; try Clipboard.Assign(imgWindow); finally imgWindow.Free; end; end; // Save the bitmap to a file // Das Bitmap in einer Datei speichern: procedure TForm1.Button2Click(Sender: TObject); var imgWindow: TBitmap; begin imgWindow := TBitmap.Create; try imgWindow := Form1.GetFormImage; imgWindow.SaveToFile('c:\FormImage.bmp'); finally imgWindow.Free; end; end;