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;
ImageArray:
array[1..10]
of TImage;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if not Assigned( NewTimer )
then begin
NewTimer := TTimer.Create (
Nil);
NewTimer.Interval := 20;
NewTimer.Enabled := True;
NewTimer.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);
var
i: integer;
begin
for i := Low(ImageArray)
to High(ImageArray)
do
with ImageArray[i]
do
Top := Top - 3;
end;
end.