频道分类

Delphi GIF 动画建立

作者:admin 来源: 日期:2019/10/5 2:30:40 人气: 标签:

 
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;