var
Form1: TForm1;
bm: TBitmap;
implementation
{$R *.DFM}
// Screen Abbild Anzeigen und Speichern
procedure TForm1.Button1Click(Sender: TObject);
var dc: HDC;
begin
bm := TBitmap.Create;
DC := CreateDC('DISPLAY', nil, nil, nil);
// Sreen-Bild in image1 kopieren
StretchBlt(image1.canvas.handle, 0, 0, image1.Width, image1.Height,
dc, 0, 0, screen.Width, screen.Height,SRCCopy);
bm.Width := screen.Width;
bm.Height := screen.Height;
// Zweites Beispiel ohne Image
// Sreen-Bild in Bitmap kopieren
BitBlt(bm.canvas.handle, 0, 0, screen.Width, screen.Height, dc, 0, 0, SRCCopy);
// Bitmap in Datei speichern
bm.SaveToFile('./ScreenBitmab.bmp');
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
bm.Free;
end;
|