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

📄 biaofengxsurface.h

📁 一个可以加载图片作为下拉菜单的symbian手机示例
💻 H
字号:
/*
============================================================================
 Name        : XSurface.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CXSurface declaration
============================================================================
*/

#ifndef XSURFACE_H
#define XSURFACE_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

// CLASS DECLARATION
#include "BiaofengXPic.h"

#define TEXT_LEFT    1
#define TEXT_RIGHT   2
#define TEXT_TOP     4
#define TEXT_BOTTOM  8
#define TEXT_HCENTER 16

/**
*  CXSurface
* 
*/
class CXSurface : public CBase
{
public: // Constructors and destructor
	~CXSurface();
	static CXSurface* NewL(TSize asize  );
	static CXSurface* NewLC(TSize asize  );

	void BitBlt(TInt x,TInt y,CXPic *apic);
    void BitBlt(TInt x,TInt y,CXPic *apic,TRect asrc_r);

	void Line(TInt x1, TInt y1,TInt x2, TInt y2,TRgb color);
	void Rect(TInt x, TInt y,TInt w,TInt h,TRgb color);
	void Rect(const TRect& r,TRgb color);
	void Fill(TInt x, TInt y,TInt w,TInt h,TRgb color);
	void Fill(const TRect& r,TRgb color);
	void Text(const TDesC& text,TInt x,TInt y,TRgb color,const CFont * font=NULL,TInt mode=TEXT_LEFT|TEXT_TOP);

	void SetClip(TInt x,TInt y,TInt w,TInt h);

	CFbsBitmap* GetFbsBitmap();
	CXPic*   GetBitmap();
	TInt     GetWidth();
	TInt     GetHeight();

	static TInt GetTextWidthInPix(const TDesC& text,const CFont * font=NULL);
	static TInt GetTextHeightInPix(const CFont * font=NULL);
private:
	CXSurface();
	void ConstructL(TSize asize );
private:
	CXPic*              m_iBitmap;
	CFbsBitmapDevice*   m_iBitmapDevice;
	CFbsBitGc*          m_iBitmapGc;
};

#endif // XSURFACE_H

⌨️ 快捷键说明

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