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

📄 cbitmap.h

📁 Symbian手机游戏,可运行于S60 1.x和2.x下, Carbide.C++ & Vs.Net2003下编译 游戏为吞食鱼的手机版,通过服用比自己体积小的鱼而使自己长大
💻 H
字号:
///////////////////////////////////////////////////////////////////////////////
//
// CBitmap.h
//
// Copyright (c) 2003 Forum Nokia.  All rights reserved.
//
// 	 Technology developed by Rocket Science Oy Ltd
//
///////////////////////////////////////////////////////////////////////////////


#ifndef __CBITMAP_H__
#define __CBITMAP_H__

// INCLUDE FILES
#include <e32base.h>
#include <gdi.h>

// CLASS DECLARATION

/**
* CBitmap class handles loading, creation and drawing
* of bitmap images.
*/
class CBitmap
	{
	public:

		/**
		* Two-phased constructors.
		*/
		static CBitmap* NewL( const TSize& aSize );
		static CBitmap* NewL( TUint16* aData, const TSize& aSize, TDisplayMode aMode );
		static CBitmap* NewL( const TFileName& aFileName, TInt aIndex );

		/**
		* Destructor.
		*/	
		~CBitmap();

	private:

		/**
		* Default constructor
		*/
		CBitmap();
		
	public: // New methods

		/**
		* Destroy current image data
		*/
		void Destroy();

		/**
		* Draws image to the given destination.
		* @param aTarget Target bitmap.
		* @param aPosition Target position.
		*/
		void Draw( CBitmap& aTarget, const TPoint& aPosition );
	
		/**
		* Set data pointer of the image
		* @param aData Target bitmap.
		*/		
		void SetData( TUint16* aData );

		/**
		* Set the mask color of image.
		* @param aColor This color will not be drawn.
		*/		
		void SetMaskColor( TUint16 aColor );

		/**
		* Sets the drawing rectangle of image.
		* By default the drawing rectangle is size of the image.
		* @param aRect Area to draw.
		*/	
		void SetDrawRect( const TRect& aRect );
		
		/**
		* Clear image with color.
		* @param aRgb RGB value of fill color.
		*/		
		void Clear( TRgb aRgb );

		/**
		* Returns the size of image.
		* @return TSize Image size.
		*/
		TSize Size();
		
		/**
		* Sets the size of image.
		* @param aSize New size for the image.
		*/
		void SetSize(const TSize& aSize);

		/**
		* Returns the pointer to the image data.
		* @return TUint16* Image data.
		*/		
		TUint16* Data();		

		/**
		* Returns the color mode of image.
		* @return TDisplayMode Image color mode.
		*/
		TDisplayMode Mode();

		/**
		* Returns current mask color.
		* @return TUint16 Image mask color.
		*/
		TUint16 MaskColor();

		/**
		* Returns current drawing rectangle.
		* @return TRect Image drawing rectangle.
		*/
		TRect DrawRect();
	
	private: // Data members

		TSize iSize;			/// bitmap size
		TUint16* iData;			/// bitmap data
		TDisplayMode iMode;		/// bitmap color mode
		TUint16 iMaskColor;		/// mask color
		TRect iDrawRect;		/// draw area
	};

#endif

// End of file

⌨️ 快捷键说明

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