You Are Here:

Community: Wiki

This page was last modified 12:00, 29 March 2009.

Gif animation for symbian 2nd and 3rd edition phones

From Forum Nokia Wiki

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.

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia