×
Namespaces

Variants
Actions

Gif animation for symbian 2nd and 3rd edition phones

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
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->LoadImageL(_L("c:\\nokia\\images\\anim.gif"),EColor4K);
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

Source:

iGifFileDataprovider = new (ELeave) CICLAnimationDataProvider;
iGifFileDataprovider->SetFileL(iFsSession,_L("C:\\nokia\\images\\anim.gif"));
 
igifanimationconfig.iFlags = TAnimationConfig::ELoop;
igifanimationconfig.iData = 10000;
TPoint gifpoint = Position();
iGifAnimatior = CBasicAnimation::NewL(iGifFileDataprovider,gifpoint,CEikonEnv::Static()
->WsSession(),Window());
iGifAnimatior->Start(igifanimationconfig);
 
//In your Draw method
iGifAnimatior->Draw(gc);


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.
49 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.

×