📄 csplash.cpp
字号:
#include <eikenv.h>
#include "CSplash.h"
#include <images.mbg>
// construct and destruct
// NewL()
CSplash* CSplash::NewL(CWindowGc& aGc, RWindow& aWindow)
{
CSplash* self = new (ELeave) CSplash(aGc, aWindow);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
CSplash::CSplash(CWindowGc& aGc, RWindow& aWindow)
: iGc( aGc )
, iWindow( aWindow )
{}
// ~CSplash()
CSplash::~CSplash()
{
delete ibitmap;
ibitmap = NULL;
}
// ConstuctL()
void CSplash::ConstructL()
{
// load the bitmap from an .mbm file
_LIT(KPathName, "\\System\\Apps\\Tetris\\images.mbm");
ibitmap = CEikonEnv::Static()->CreateBitmapL(KPathName, EMbmImagesLogo);
iCount = -11;
}
///////////////////////////////////////////////////////////////////////
// Other method
// Show() @return 1 -- keep running else stop
TBool CSplash::Draw()
{
if(iCount == 0)
User::After(1000000);
++iCount;
if(iCount < 11)
{
iGc.Activate( iWindow );
iGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
iGc.SetBrushColor(KRgbBlack);
iGc.Clear();
if(iCount < 0)
iGc.SetFadingParameters(0, iCount*25);
else
iGc.SetFadingParameters(0, 255 - iCount*25);
iGc.SetFaded(ETrue);
iGc.BitBlt(TPoint(20, 60), ibitmap);
iGc.Deactivate();
}
else
{
User::After(100000);
iGc.Activate( iWindow );
iGc.SetFaded(EFalse);
iGc.Deactivate();
iCount = -11;
return 0;
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -