Namespaces

Variants
Actions

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.

How to display gif files

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: huwell (29 Jun 2007)
Last edited: hamishwillee (30 May 2013)

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)

This page was last modified on 30 May 2013, at 04:38.
70 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.

×