I'm trying to display an animated GIF in a Firemonkey HD form using TImage but I do not see any methods for animation.
Using Vcl.Imaging.gifImg is not an option because types differ.
Can someone suggest a way to solve this problem or probably component to animate GIF images under Firemonkey?
The only way I find for now is:
create TGIFImage instance and load the GIF image
loop through gif.images:
a. save current image to stream
b. Image1.bitmap.loadFromStream [Image1 is FMX:TImage]
Is there any smarter solution?
TBitmaporTCanvasare not compatible. That's the reason of the stream usage; otherwise you would be able to use classes likeTGIFImageorTGIFRendererdirectly. AndTTimeris prefectly sufficient for animations. If you'd use worker thread then you would have to synchronize UI with each frame rendering and that would, as iPath correctly said, enqueue messages into the UI main thread's message queue. EvenTGIFRendereritself uses timer, not a thread for rendering loop ;-) - TLama