unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 =
class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1 : TForm1;
x : Integer;
Background : TBitmap;
Front : TBitmap;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Background := TBitmap.Create;
Background.Width := 200;
Background.Height := 200;
Background.Canvas.Brush.Color := clgreen;
Background.Canvas.FillRect(Classes.Rect(0,0,200,200));
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
inc(x);
Front := TBitmap.Create;
Front.Width := 200;
Front.Height := 200;
Front.Assign(Background);
Front.Canvas.TextOut(1,1,IntToStr(x));
BitBlt(Image1.Canvas.Handle,0,0,200,200,Front.Canvas.Handle,0,0,SRCCOPY);
{nur als Test, ob logisch irgendwas falsch ist}
BitBlt(Canvas.Handle,0,0,200,200,Front.Canvas.Handle,0,0,SRCCOPY);
Front.Free;
end;
end.