Simple Splash screen implementation
From Forum Nokia Wiki
CSimpleSplashScreen.cpp shows very simple implementation of a splash screen. In it the splash screen image is thought to be stored in a image file called splash.mbm (that is in epoc multi bitmap format) and as its first bitmap image. For real implementations replace the <My SID> with your applications secure identifier and store the image in your private folder.
To use CSimpleSplashScreen, just construct it in your application user interface class and start a timer, and when the timer expires, just destroy the splash screen and start your application normal start screen.
SimpleSplashScreen.cpp
#include <EIKENV.H> #include <EIKAPPUI.H> #include <aknutils.h> #include <eikapp.h> _LIT(KtxMySplashImage ,"\\private\\<My SID>\\splash.mbm" ); CSimpleSplashScreen::~CSimpleSplashScreen() { delete iBgPic; } CSimpleSplashScreen* CSimpleSplashScreen::NewL(void) { CSimpleSplashScreen* self = new(ELeave)CSimpleSplashScreen(); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); return self; } void CSimpleSplashScreen::ConstructL(void) { CreateWindowL(); SetRect(CEikonEnv::Static()->EikAppUi()->ApplicationRect()); TFindFile AppFile(CCoeEnv::Static()->FsSession()); if(KErrNone == AppFile.FindByDir(KtxMySplashImage, KNullDesC)) { iBgPic = new (ELeave) CFbsBitmap(); User::LeaveIfError(iBgPic->Load(AppFile.File(),0)); } ActivateL(); DrawNow(); } void CSimpleSplashScreen::Draw(const TRect& /*aRect*/) const { CWindowGc& gc = SystemGc(); gc.SetBrushColor(KRgbWhite); gc.SetBrushStyle(CGraphicsContext::ESolidBrush); gc.Clear(Rect()); if(iBgPic) { if(iBgPic->Handle()) { gc.DrawBitmap(Rect(),iBgPic); } } }
SimpleSplashScreen.h
#include <coecntrl.h> // CCoeControl class CFbsBitmap; //------------------------------------------------------------------- // //------------------------------------------------------------------- class CSimpleSplashScreen : public CCoeControl { public: static CSimpleSplashScreen* NewL(void); ~CSimpleSplashScreen(); private: void ConstructL(void); void Draw(const TRect& aRect) const; private: CFbsBitmap* iBgPic; };
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| App.closed error on 6600 | FatalError | Mobile Java General | 16 | 2004-02-16 13:54 |
| Nokia 7650 - application fails on some software versions | marthos | Mobile Java General | 5 | 2003-10-13 18:52 |
| Getting SIM Status in 3rd Edition | saji_iq | General Symbian C++ | 19 | 2008-09-17 14:03 |
| keyPressed有延迟现象? | tcwingzero | Other Programming Discussion 关于其他编程技术的讨论 | 3 | 2004-04-13 13:23 |
| Game Icon (Solution urgently required) | siddharth23 | Mobile Java General | 5 | 2004-01-13 19:15 |
