Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
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.

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.