How to use animated gif in Firemonkey?

前端 未结 3 597
不思量自难忘°
不思量自难忘° 2021-01-14 13:11

How can I use animated GIF in Firemonky. I can load the gif using Timage but it\'s not animating. I am using Delphi 10.2 tokyo.

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-14 13:44

    Maybe a bit late, but found a simple solution on this page : http://www.raysoftware.cn/?p=559 Download the file http://www.raysoftware.cn/wp-content/uploads/2016/12/FMXGif.rar, uncompress, and take the file FMX.GifUtils out, and put in your the directory of your application

    Put a image component on your form with name Image1

    Put the file FMX.GifUtils in your use on top

    Declare in your form in private :

    FGifPlayer: TGifPlayer;
    

    in the create of your form:

     FGifPlayer := TGifPlayer.Create(Self);
     FGifPlayer.Image := Image1;
     FGifPlayer.LoadFromFile('youfilename.gif');
     FGifPlayer.Play;
    

    That's it;

提交回复
热议问题