引入 Vcl.Imaging.GIFImg 单元
Image1.Picture.LoadFromFile('xxxxx.gif');
// AnimationSpeed 设定动画速度,值越大,速度越快;
TGIFImage(Image1.Picture.Graphic).AnimationSpeed := 500;
TGIFImage(Image1.Picture.Graphic).Animate := True;
利用图片制作gif动态图片
var Gif:TGifImage;
begin
//Setting the delay for each frame
TGIFGraphicControlExtension.Create(Gif.Add(image1.Picture.Bitmap)).Delay := 300;
TGIFGraphicControlExtension.Create(Gif.Add(image2.Picture.Bitmap)).Delay := 300;
TGIFGraphicControlExtension.Create(Gif.Add(image3.Picture.Bitmap)).Delay := 300;
//Adding loop extension in the first frame (0 = forever)
TGIFAppExtNSLoop.Create(Gif.Images.Frames[0]).Loops := 0;
Gif.SaveToFile('gif.gif');
end;