unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Main1: TImage; btn1: TButton; procedure btn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses GIFImg; //一定要加这个不然编译通不过 { $R *.dfm} procedure TForm1.btn1Click(Sender: TObject); begin Main1.Picture.LoadFromFile('E:\344.gif'); TGIFImage(Main1.Picture.Graphic).AnimationSpeed := 100; TGIFImage(Main1.Picture.Graphic).Animate := True; end;