Animated gif in Delphi XE 3 forms [duplicate]

走远了吗. 提交于 2019-12-23 20:05:53

问题


Possible Duplicate:
How to use Animated Gif in a delphi form

I recently updated my version of Delphi 7 to Delphi XE3.

Using Delphi 7, I used a component to put a GIF on a TImage, delphi XE3 already has compatibility with gif's, it is not necessary to install any additional third party components.

my question is: when I attach the gif to TImate, it becomes static, shows only the first frame.

is there any command for this? like Image1.Play or something?


回答1:


To get the animation started do like this:

(Image1.Picture.Graphic as TGIFImage).AnimateLoop := glEnabled;
(Image1.Picture.Graphic as TGIFImage).Animate := true;

To control the animation speed, set the AnimationSpeed property between 0..1000, default value is 100.

See also @DavidHeffernan's answer, How to use Animated Gif in a delphi form




回答2:


Required unit:

uses Vcl.Imaging.GIFImg

Code to animate:

TGIFImage(Image1.Picture.Graphic).Animate := True;


来源:https://stackoverflow.com/questions/14158186/animated-gif-in-delphi-xe-3-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!