Delphi的动画效果例子


源代码:

unit Unit1;

interface

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

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

var
  Form1: TForm1;

implementation
var Index: integer;
{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  if Index = 0 then
  begin
   Image1.visible:= true;
   Image2.visible:= false;
   Image3.visible:= false;
   Image4.visible:= false;
   Index:= Index + 1;
  end
  else if Index = 1 then
  begin
   Image1.visible:= false;
   Image2.visible:= true;
   Image3.visible:= false;
   Image4.visible:= false;
   Index:= Index + 1;
  end
  else if Index = 2 then
  begin
   Image1.visible:= false;
   Image2.visible:= false;
   Image3.visible:= true;
   Image4.visible:= false;
   Index:= Index + 1;
  end
  else if Index = 3 then
  begin
   Image1.visible:= false;
   Image2.visible:= false;
   Image3.visible:= false;
   Image4.visible:= true;
   Index:= 0;
  end;
end;

end.


联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678