unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TBitMapArray=Array[0..3]
of TBitMap;
TForm2 =
class(TForm)
Timer1: TTimer;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
FBitMapArray:TBitMapArray;
FIndex:Integer;
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
Procedure BMPCreateAndLoadFromFile(
var bmp:TBitmap;
const fn:
String);
begin
bmp := TBitmap.Create;
bmp.LoadFromFile(fn);
end;
procedure TForm2.FormCreate(Sender: TObject);
Const
Path='
C:\Bilder\IconCollection\ix_ap_all\48x48\plain_bitmap\';
begin
BMPCreateAndLoadFromFile(FBitMapArray[0],Path + '
about.tex');
BMPCreateAndLoadFromFile(FBitMapArray[1],Path + '
add.xxx');
BMPCreateAndLoadFromFile(FBitMapArray[2],Path + '
add2.yyy');
BMPCreateAndLoadFromFile(FBitMapArray[3],Path + '
bookmark.aaa');
end;
procedure TForm2.FormDestroy(Sender: TObject);
var
i:Integer;
begin
for I := 0
to High(FBitMapArray)
do
FreeAndNil(FBitMapArray[i]);
end;
procedure TForm2.Timer1Timer(Sender: TObject);
begin
Image1.Picture.Assign(FBitMapArray[FIndex]);
inc(FIndex);
if FIndex > 3
then Findex := 0;
end;
end.