How I can play gif picture animation using Firemonkey that will be used in Android and iOS app ?
I am using Delphi XE 8.
Note: I saw this question Animated GIF in Firemonkey but I dont have the animation as sprites only as a single gif file.
How I can play gif picture animation using Firemonkey that will be used in Android and iOS app ?
I am using Delphi XE 8.
Note: I saw this question Animated GIF in Firemonkey but I dont have the animation as sprites only as a single gif file.
You can use third-party library. One of the best options is the control TSkAnimatedImage of the library Skia4Delphi: https://github.com/skia4delphi/skia4delphi
Due to how Firemonkey works with images and bitmaps, TGIFImage
doesn't exist anymore.
So the easiest way of doing this is by using a TWebBrowser
component and then loading your .gif
file into that component
For Firemonkey Apps you can set the deployment of files for each different platform, but in the case of a Windows Firemonkey App you can add your .gif
files to your project and then set the URL to the local file (or you can set it to a remote URL if you want to use a gif that you don't have)
And to get your gif in the browser for Win simply set the gif as the URL
WebBrowser1.URL := 'file://'+ ExtractFilePath(ParamStr(0))+'images\somegif.gif';
WebBrowser1.Navigate;