unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
bmp: TBitmap;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
bmp := TBitmap.Create;
bmp.Width := Screen.Width;
bmp.Height := Screen.Height;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
freeandnil(bmp);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i, b: integer;
dc: hdc;
begin
dc := GetDC(0);
b := GetTickCount;
for i := 0 to 9do
BitBlt(bmp.Canvas.Handle, 0, 0, bmp.Width, bmp.Height, dc, 0, 0, SRCCOPY);
showmessage(inttostr(GetTickCount - b));
end;
end.