Form with alternating background. If it worked. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Form with alternating background. If it worked.

XzentuXzentu Posts: 7Member
This unit is supposed to display a background that changes. It however doesn't show any images at all. The form is set up, and I have images that fit the reference in the load from file line.
See anything that sticks out as wrong?
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
Image1: TImage;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
Var
i : Integer = 1 ;

procedure TForm1.Timer1Timer(Sender: TObject);
Var
Bitmap: TBitmap;
begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile
('picturesPic'+IntToStr(i)+'.bmp');
Image1.Picture.Bitmap := Bitmap;
Image1.Stretch := True;
Bitmap.Free;
i:=i+1;
If i = 3
Then i := 1;

end;

end.


Sign In or Register to comment.