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?

有帮助吗?

解决方案 2

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

其他提示

Required unit:

uses Vcl.Imaging.GIFImg

Code to animate:

TGIFImage(Image1.Picture.Graphic).Animate := True;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top