hab alles timages durch tbitmap ersetzt ,
ergibt gleiche fehlermeldung beim speichern hier nochmal der code
Delphi-Quellcode:
function ScreenToFile():tbitmap;
var
screenimage:tbitmap;
Canvas: TCanvas;
begin
Canvas := TCanvas.Create;
try
Canvas.Handle := GetWindowDC(0);
try
screenimage := tbitmap.Create();
try
screenimage.Width := Screen.DesktopWidth;
screenimage.Height:= Screen.DesktopHeight;
screenimage.PixelFormat := pf32bit;
BitBlt(screenimage.Canvas.Handle, 0, 0, Pred(Screen.DesktopWidth), Pred(
Screen.DesktopHeight), Canvas.Handle, Screen.DesktopLeft,
Screen.DesktopTop, screenimage.Canvas.CopyMode);
//screenimage.Picture.bitmap.SaveToFile('c:\screen.bmp');
finally
ScreenToFile:=screenimage;
screenimage.Free;
end;
finally
ReleaseDC(0, Canvas.Handle);
end;
finally
Canvas.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
image1.Picture.Bitmap := (screentofile());
image1.Picture.Bitmap.SaveToFile('C:\neuertest.bmp');
end;