⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gitaappview.cpp

📁 Symbian 位图的显示
💻 CPP
字号:
/*
 ============================================================================
 Name		: GitaAppView.cpp
 Author	  : 
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <coemain.h>
#include "GitaAppView.h"
#include <aknutils.h>
#include <Gita.mbg>

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CGitaAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CGitaAppView* CGitaAppView::NewL(const TRect& aRect)
	{
	CGitaAppView* self = CGitaAppView::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

// -----------------------------------------------------------------------------
// CGitaAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CGitaAppView* CGitaAppView::NewLC(const TRect& aRect)
	{
	CGitaAppView* self = new ( ELeave ) CGitaAppView;
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

// -----------------------------------------------------------------------------
// CGitaAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CGitaAppView::LoadBitmap()
	{
	iBitmap = new (ELeave) CFbsBitmap();
	//_LIT(KMbmFile,"Bitmap.mbm");
	_LIT(KMbmFile,"\\system\\apps\\Gita\\Gita.mbm");
	TFileName mbmFile(KMbmFile);
	CompleteWithAppPath(mbmFile);
	User::LeaveIfError(iBitmap->Load(mbmFile,EMbmGitaGita));
	
	}
void CGitaAppView::ConstructL(const TRect& aRect)
	{
	// Create a window for this application view
	CreateWindowL();

	// Set the windows size
	SetRect(aRect);
	LoadBitmap();
	// Activate the window, which makes it ready to be drawn
	ActivateL();
	}

// -----------------------------------------------------------------------------
// CGitaAppView::CGitaAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CGitaAppView::CGitaAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CGitaAppView::~CGitaAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CGitaAppView::~CGitaAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CGitaAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CGitaAppView::Draw(const TRect& /*aRect*/) const
	{
	// Get the standard graphics context
	CWindowGc& gc = SystemGc();

	// Gets the control's extent
	TRect drawRect(Rect());

	// Clears the screen
	gc.Clear(drawRect);
	TPoint topleft(40,40);
	gc.BitBlt(topleft,iBitmap);

	}

// -----------------------------------------------------------------------------
// CGitaAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CGitaAppView::SizeChanged()
	{
	DrawNow();
	}
// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -