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

📄 doublebufferedarea.cpp

📁 symbian下变换皮肤的程序,挺实用的
💻 CPP
字号:
/**
 *
 * @brief Definition of CDoubleBufferedArea
 *
 * Copyright (c) EMCC Software Ltd 2003
 * @version 1.0
 */
#include "DoubleBufferedArea.h"


// System includes
#include <bitdev.h>     // CFbsBitmapDevice
#include <bitstd.h>     // CFbsBitGc
#include <fbs.h>        // CFbsBitmap

/**
* Standard SymbianOS 2 stage constructor
*
* @param aSize The size of the double buffered area encapsulated by this class
* @param aDisplayMode The display mode - see gdi.h
*/
CDoubleBufferedArea* CDoubleBufferedArea::NewL(TSize aSize, TDisplayMode aDisplayMode)
	{
	CDoubleBufferedArea* self = new (ELeave) CDoubleBufferedArea();
	CleanupStack::PushL(self);
	self->ConstructL(aSize, aDisplayMode);
	CleanupStack::Pop();
	return self;
	}

/**
* Standard SymbianOS 2 stage constructor.  The newly created object is left on
* the cleanup stack
*
* @param aSize The size of the double buffered area encapsulated by this class
* @param aDisplayMode The display mode - see gdi.h
*/
CDoubleBufferedArea* CDoubleBufferedArea::NewLC(TSize aSize, TDisplayMode aDisplayMode)
	{
	CDoubleBufferedArea* self = new (ELeave) CDoubleBufferedArea();
	CleanupStack::PushL(self);
	self->ConstructL(aSize, aDisplayMode);
	return self;
	}

/*
* C++ constructor
*/
CDoubleBufferedArea::CDoubleBufferedArea()
	{
	}


/*
* destructor
*/
CDoubleBufferedArea::~CDoubleBufferedArea()
	{
	delete iAreaBitmap;
    delete iAreaBitmapDevice;
    delete iAreaBitmapContext;
	}

/**
* Standard SymbianOS 2nd stage construction
*
* @param aSize The size of the double buffered area encapsulated by this class
* @param aDisplayMode The display mode - see gdi.h
*/
void CDoubleBufferedArea::ConstructL(TSize aSize, TDisplayMode aDisplayMode)
	{
	//constructing offscreen play area:
	iAreaBitmap = new (ELeave) CFbsBitmap();
    iAreaBitmap->Create(aSize, aDisplayMode);
    iAreaBitmapDevice = CFbsBitmapDevice::NewL(iAreaBitmap);
    iAreaBitmapDevice->CreateContext(iAreaBitmapContext);
	}


/**
* Double buffered area context accessor
*
* @return The graphic context of the off screen bitmap
*/
CFbsBitGc& CDoubleBufferedArea::GetDoubleBufferedAreaContext() const
    {
     return *iAreaBitmapContext;
    }

/**
* Double buffered area bitmap accessor
*
* @return The off screen bitmap
*/
const CFbsBitmap& CDoubleBufferedArea::GetDoubleBufferedAreaBitmap() const
	{
	return *iAreaBitmap;
	}


/**
* Wipes the off screen bitmap
*/
void CDoubleBufferedArea::ClearBufferedArea()
	{
	iAreaBitmapContext->Clear();
	}

// End of File

⌨️ 快捷键说明

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