unit MainUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ExtDlgs, ImgList;
type
TForm1 =
class(TForm)
Button1: TButton;
Image1: TImage;
ImageList1: TImageList;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
function MakeScreenShotfunc():TBitmap;
var
Form1: TForm1;
DatName :
String;
implementation
{$R *.dfm}
var
ImgList: TImagelist;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
ImgList.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ForCedIrEctOrIeS('
C:\Dokumente und Einstellungen\Delphi');
ImgList:=TImagelist.Create(Form1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.AlphaBlend:=True;
Sleep(75);
ImgList.Add(MakeScreenShotfunc);
// Hier das PROBLEM
Sleep(75);
Form1.AlphaBlend:=False;
end;
function MakeScreenShotfunc():TBitmap;
var
DesktopDC: HDC;
Screenbit : TBitmap;
begin
DesktopDC := CreateDC('
DISPLAY',
nil,
nil,
nil);
try
Screenbit.PixelFormat := pfDevice;
Screenbit.Width := Screen.Width;
Screenbit.Height := Screen.Height;
BitBlt(Screenbit.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DesktopDC, 0, 0, SRCCOPY);
finally
DeleteDC(DesktopDC);
end;
result:=Screenbit;
end;
end.