bitmaps and forms

hello programmers.
I come to ask you about your coding knowledge.
currently working on a program in pascal.
Got a chunk of code done, then compiled it. Didn't work properly unfortunately.
Narrowed down the problem to this unit:
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.
I have image files with the associated names, as well as a form that has all the relevant items.
Any obvious errors you can spot?

Sign In or Register to comment.

Howdy, Stranger!

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

Categories