unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure DoTimer (Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
NewTimer: TTimer;
NewImage: TImage;
i: Integer = 0;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if not Assigned( NewTimer[i] )
then begin
NewTimer[i] := TTimer.Create (
Nil);
NewTimer[i].Interval := 20;
NewTimer[i].Enabled := True;
NewTimer[i].OnTimer := DoTimer;
end;
begin
NewImage := TImage.Create(
Nil);
with NewImage
do
begin
Top := 144;
Left := 8;
Picture.LoadFromFile('
xxx.bmp');
Parent := Form1;
Name := '
xxx';
end;
end;
end;
procedure TForm1.DoTimer(Sender: TObject);
begin
NewImage.Top := NewImage.Top - 3;
begin
i := i + 1;
end;
end;
end.