Registriert seit: 6. Jan 2005
Ort: Lübbecke
575 Beiträge
Turbo C++
|
Re: Screenshot immer nur weiß
9. Feb 2005, 22:21
Versuchs mal so.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
Canvas: TCanvas;
Bitmap: TBitmap;
begin
Canvas := TCanvas.Create;
try
Canvas.Handle := GetWindowDC(0);
try
Bitmap := TBitmap.Create;
try
Bitmap.Height := Screen.Height;
Bitmap.Width := Screen.Width;
BitBlt(Bitmap.Canvas.Handle,0,0,
Screen.Width,
Screen.Height,
Canvas.Handle, 0, 0,
Bitmap.Canvas.CopyMode);
Bitmap.SaveToFile('C:\Hallo.bmp');
finally
Bitmap.Free;
end;
finally
ReleaseDC(0, Canvas.Handle);
end;
finally
Canvas.Free;
end;
end;
|
|
Zitat
|