Namespaces
Variants
Actions
Revision as of 06:10, 26 July 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to display gif files

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)

157 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved