Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Gif animation for symbian 2nd and 3rd edition phones

From Wiki
Jump to: navigation, search
Article Metadata
Created: giridharn (22 May 2007)
Last edited: hamishwillee (23 Jul 2012)

Gif Animation for symbian 2nd edition phones

Derive your application container class from MPAlbAnimationObserver, and declare these

CPAlbImageViewerBasic* iViewer ;
void Notify( TAnimationEvent aEvent );

And, in your container,Animation method/function use this code. Dont forget to return count in CountComponentControls() and iViewer pointer in ComponetControl() methods.

iViewer = CPAlbImageViewerBasic::NewL(this,aRect);
iViewer->SetAnimationObserver(this,ETrue); //for looping
iViewer->PlayAnimationL(); // support image and animation

Symbian 3rd edition phones

Headers Required:

#include <ICLAnimationDataProvider.h> //CICLAnimationDataProvider
#include <BasicAnimation.h > //CBasicAnimation

Library Needed:

LIBRARY animation.lib //CICLAnimationDataProvider, CBasicAnimation


iGifFileDataprovider = new (ELeave) CICLAnimationDataProvider;
igifanimationconfig.iFlags = TAnimationConfig::ELoop;
igifanimationconfig.iData = 10000;
TPoint gifpoint = Position();
iGifAnimatior = CBasicAnimation::NewL(iGifFileDataprovider,gifpoint,CEikonEnv::Static()
//In your Draw method

Additional way showing GIF animation with image decoder API: Showing GIF animations

NOTE: basicanimattion.h is not available in 3rd edition MR release. ref: MR documentation

GIF frame rate consideration

As of S60 3rd edition FP2 the APIs mentioned above won't play well GIFs with 20 frames per second. It will just play too slow because that framework can't deliver 20FPS apparently. I've been using GIFs with only 6.66FPS and they render quite nicely on the phone. It might be worth testing 10 or 15FPS too see if they play properly. You may find that different devices deliver different performance.

This page was last modified on 23 July 2012, at 07:56.
38 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.