DelphiXE 显示GIF动画  转老帅

DelphiXE 显示GIF动画

DelphiXE可以直接显示GIF动画,不需要第三方控件的支持。只要引用GifImg单元即可。

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/luckForever/p/7254623.html