?? demobmpappview.cpp
字號:
/* Copyright (c) 2005, Nokia. All rights reserved */
//#include <gdi.h>
#include <eikenv.h>
#include <fbs.h>
#include <eikenv.h>
#include <coecntrl.h>
#include "DemoBMPAppView.h"
#include "demobmp.mbg"
_LIT(pathAppMbm,"\\system\\apps\\demobmp\\demobmp.mbm");
//new size to scale image
static const TInt KNewImageWidth = 150;
static const TInt KNewImageHeight = 150;
CDemoBMPAppView* CDemoBMPAppView::NewL(const TRect& aRect)
{
CDemoBMPAppView* self = NewLC(aRect);
CleanupStack::Pop(self);
return self;
}
CDemoBMPAppView* CDemoBMPAppView::NewLC(const TRect& aRect)
{
CDemoBMPAppView* self = new (ELeave) CDemoBMPAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
return self;
}
void CDemoBMPAppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
image = new (ELeave) CFbsBitmap();
image = iEikonEnv->CreateBitmapL( pathAppMbm, EMbmDemobmpTemp);
iScaler = CMdaBitmapScaler::NewL();
SetRect(aRect);
ActivateL();
}
CDemoBMPAppView::CDemoBMPAppView()
:iobserver(*this)
{
// Add any construction code that can not leave here
}
CDemoBMPAppView::~CDemoBMPAppView()
{
// Add any destruction code here
if (image)
delete image;
delete iScaler;
iScaler = NULL;
}
void CDemoBMPAppView::Draw(const TRect& /*aRect*/) const
{
// Clear the screen
CWindowGc& gc = SystemGc();
gc.Clear(Rect());
gc.BitBlt(TPoint(0,0),image);
iScaler->ScaleL( iobserver,*image,TSize(KNewImageWidth,KNewImageHeight));
}
void CDemoBMPAppView::MiuoOpenComplete(TInt aError)
{
if (aError == KErrNone)
{
_LIT(MSG1, "SCAN FINISHED! " );
TBuf<60> buffer;
buffer.Num(3);
_LIT(MSG2, " files");
buffer.Append(MSG2);
CEikonEnv::Static()->AlertWin( MSG1, buffer ); //打印警告信息
}
}
void CDemoBMPAppView::MiuoCreateComplete(TInt aError)
{
;
}
void CDemoBMPAppView::MiuoConvertComplete(TInt aError)
{
;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -