Delphi 2009 gif动画方法

以前要在 Delphi 中显示 GIF 动画,一种办法是使用第三方组件,别一种方法就是使用 WebBrowser 组件。在 Delphi 2009 中,其内部已支持 GIF 了(可能在 Delphi 2005 和 Delphi 2006 中已支持了,未确认)。关于 GIF 的相关类是 TGIFImage,在 GIFImg 单元中,看下面的代码,窗体中的 GIF 就动起来了:

uses GIFImg;
procedure TForm1.FormCreate(Sender: TObject);
begin
  // 先在窗体上放一个 TImage 组件:Image1;
  Image1.Picture.LoadFromFile('C:\Example.gif');
  // AnimationSpeed 设定动画速度,值越大,速度越快;
  TGIFImage(Image1.Picture.Graphic).AnimationSpeed := 500;
  TGIFImage(Image1.Picture.Graphic).Animate := True;
end;
原文地址:https://www.cnblogs.com/linximf/p/1676912.html