在delphi 2009中创建一个gif动画文件?

在delphi 2009中创建一个gif动画文件?,第1张

概述gif := TgifImage.Create;gif.Width := 100;gif.Height := 100;gif.AnimationSpeed := 500;gif.Animate := true;gif.add(image1.Picture.Bitmap);gif.add(image2.Picture.Bitmap);gif.add(image3.Picture.Bit
gif := TgifImage.Create;gif.WIDth := 100;gif.Height := 100;gif.AnimationSpeed := 500;gif.Animate := true;gif.add(image1.Picture.Bitmap);gif.add(image2.Picture.Bitmap);gif.add(image3.Picture.Bitmap);gif.Savetofile('gif.gif');

这只循环一次,速度不是500?

如何让它循环并设置速度?

解决方法 编写原始 TGIFImage的Anders Melander有以下 answer.

You need to add a “netscape Loop” extension block to the first frame of your GIF.
The loop block must be the first extension you define for the frame or else it will not work.

See the 07002 for an example of how to build an animated GIF.

以下是Animate demo的代码摘录:

// Add the source image to the animationResult := GIF.Add(Source);// netscape Loop extension must be the first extension in the first frame!if (GIF.Images.Count = 1) thenbegin  LoopExt := TGIFAppExtNSLoop.Create(Result);  LoopExt.Loops := 0; // Number of loops (0 = forever)end;

你可以查看TGIFImage documentation here.

总结

以上是内存溢出为你收集整理的在delphi 2009中创建一个gif动画文件?全部内容,希望文章能够帮你解决在delphi 2009中创建一个gif动画文件?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1251284.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存