Symbian
Symbian OS Library

FAQ-1108 Are animated GIFs supported by Symbian OS?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Multimedia
Created: 08/10/2004 Modified: 09/13/2004
Number: FAQ-1108
Platform: Symbian OS v6.1, Symbian OS v7.0, Symbian OS v7.0s, Symbian OS v8.0

Question:
I am developing an application and would like to make use of animated GIF files.
What versions of the OS support the decoding of this file format?


Answer:
Animated GIF decoding is supported in v6.1 and v7.0 through the CMdaImageFileToBitmapUtility and CMdaImageDescToBitmapUtility classes.
In OS releases from v7.0s onward, support is provided through the CImageDecoder class inside the Image Conversion Library [ICL].

Using these APIs you can call Convert() to convert a given frame inside the image into a bitmap.

The FrameCount() API is used to retrieve the current frame count. It should be noted however that the FrameCount() only returns the count from the starting frame to the next available frame. For example if there were 7 frames in a given animated image, but you had already decoded 5 then the framecount would be 6 because the header for anything past the 6th image would not yet have been decoded.

Using the FrameInfo() method of the above classes it is possible to retrieve a TFrameInfo structure containing an iDelay parameter that dictates the amount of time the current frame should be displayed before displaying the next frame. Hence an acceptable way to display an animated GIF would be to decode all the images in advance and then use the iDelay for each frame to alternately display each of the images for a set amount of time.

Note that the Symbian OS APIs do not support the retrieval of loop information from the frames.

For more information please refer to the Symbian Developer Library - referring to the sections on Image Conversion.