Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Trying to figure out what went wrong

XzentuXzentu Posts: 7Member
hello fellow pascal 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 problems you can spot?

Sign In or Register to comment.