×
Namespaces

Variants
Actions
Revision as of 06:10, 26 July 2012 by hamishwillee (Talk | contribs)

How to display gif files

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: huwell (29 Jun 2007)
Last edited: hamishwillee (26 Jul 2012)

You could play animated gif in an easy way.


1st/2nd code

#include <palbimageviewerbasic.h>
...
iGifImage = CPAlbImageViewerBasic::NewL(this, TRect(TPoint(0, 0), TSize(rect.Width(),rect.Height())));
iGifImage->SetImageNameAndDisplaymodeL(aGifName ,CEikonEnv::Static()->DefaultDisplayMode());
iGifImage->SetAnimationObserver(this, ETrue);
iGifImage->LoadImageL();
iGifImage->ScaleOptimumL();
 
if(iGifImage->IsAnimation())
iGifImage->PlayAnimationL();


3rd code

#include <ICLAnimationDataProvider.h>
...
iGifProvider = new (ELeave) CICLAnimationDataProvider;
iGifProvider->SetFileL(iFs, _L("C:\\YourGifName.gif"));
 
aGifconfig.iFlags = TAnimationConfig::ELoop;
aGifconfig.iData = 10000;
TPoint aPoint = Position();
 
iGifImage = CBasicAnimation::NewL(iGifProvider, aPoint, CEikonEnv::Static()->WsSession(),Window());
 
iGifImage->Start(aGifconfig);
 
//put this code in the Draw() function
iGifImage->Draw(gc);



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

Useful links

Gif (Graphics Interchange Format)

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

×