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

📄 eb_graphics.h

📁 这是法国Kaleido公司提供了一个手机mmi设计平台
💻 H
📖 第 1 页 / 共 2 页
字号:
	<method>getHeight</method>
	<java>int getHeight(String string)</java>
	<cpp>virtual int getHeight(char* string)</cpp>
	<descr>
	<p>Returns the height of a String in the current Font of the Graphics.</p>
	</descr>
	<notes></notes>
	<examples></examples>
	</api>
	*/
	virtual int getHeight()=0 ;

	/*
	<api>
	<class>Graphics</class>
	<method>getRGB</method>
	<java></java>
	<cpp>void getRGB(int x, int y,  pchar r, pchar g, pchar b);</cpp>
	<descr>
	<p>Gets the RGB value of the dot situated at x/y.</p>
	</descr>
	<notes>
	<p>Caution: accessing individual dots may be very inefficient; Make sure it's really the best way to do what you want prior to going this way. The implementation of this method is not mandatory, but it is used by the internal versions of reduce(), enlarge() and extract().</p>
	<p>This function may also be inlined.</p>
	</notes>
	<examples></examples>
	</api>
	*/
	virtual void getRGB(int x, int y,  unsigned char* r, unsigned char* g, unsigned char* b)=0 ;
	virtual void getRGBA(int x, int y,  unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a)
	{ getRGB(x, y, r, g, b); *a=0xff;} ;

	/*
	<api>
	<class>Graphics</class>
	<method>putRGB</method>
	<java></java>
	<cpp>void putRGB(int x, int y, unsigned char r, unsigned char g, unsigned char b);</cpp>
	<descr>
	<p>Sets the RGB value of the dot located at x/y.</p>
	</descr>
	<notes>
	<p>Accessing individual dots may be very inefficient; Make sure it's really the best way to do what you want prior to going this way. The implementation of this method is not mandatory, but it is used by the internal versions of reduce(), enlarge() and extract().</p>
	<p>This function may also be inlined.</p>
	</notes>
	<examples></examples>
	</api>
	*/
	virtual void putRGB(int x, int y, unsigned char r, unsigned char g, unsigned char b)=0;
	virtual void putRGBA(int x, int y, unsigned char r, unsigned char g, unsigned char b, unsigned char /*a*/)
	{ putRGB(x, y, r, g, b) ; }

	virtual void setTransparent( unsigned char tR,unsigned char tG,unsigned char tB);
	virtual void getTransparent(unsigned char* tR,unsigned char* tG,unsigned char* tB);
	/*
	* Draws an extract of a source Graphics on the current one.
	* The upper-left corner's coordinates of the extract to draw is(xF, yF).
	* Its size is (w, h) and the target's upper-left corner's coordinates is (xT, yT).
	*/
	virtual void drawExtract(int xT, int yT, Graphics* gSource, int xF, int yF, int w, int h);

	/*
	<api>
	<class>Graphics</class>
	<method>drawMask</method>
	<java></java>
	<cpp>virtual void drawMask(int xT, int yT, Graphics* gSource, int xF, int yF, int w, int h, unsigned char tR, unsigned char tG, unsigned char tB)</cpp>
	<descr>
	<p>This method draws dots on the current Graphics, using the color (tR, tG, tB). The concerned dots are defined by a mask that is the non transparent dots of gSource. The mask size is (w, h) and the target's upper-left corner's coordinates is (xT, yT).</p>
	</descr>
	</api>
	*/
	virtual void drawMask(int xT, int yT, Graphics* gSource, int xF, int yF, int w, int h, unsigned char tR, unsigned char tG, unsigned char tB);

	/*
	<api>
	<class>Graphics</class>
	<method>setDrawRegion</method>
	<java>void setDrawRegion(int left,int top,int width,int height)</java>
	<cpp>virtual void setDrawRegion(int left,int top,int width,int height)</cpp>
	<descr>
	<p>This method sets the region of the current surface that may be affected by the drawings to come.</p>
	</descr>
	</api>
	*/
	virtual void setDrawRegion(int left,int top,int width,int height);

	/*
	* Set a region on the current surface that MUST be affected by the 
	* drawings to come.
	*/
	virtual void setReservedRegion(int left,int top,int width,int height);


	/*
	* Sets the color of the drawings to come.
	*/

	/*
	<api>
	<class>Graphics</class>
	<method>setColor</method>
	<java></java>
	<cpp>virtual void setColor(unsigned char tRed, unsigned char tGreen, unsigned tBlue)or virtual void setColor(unsigned int iARGB)</cpp>
	<descr>
	<p>Selects the color used to render the drawings</p>
	</descr>
	</api>
	*/
	virtual void setColor(unsigned char tR,unsigned char tG,unsigned char tB);
	virtual void setColor(unsigned int tARGB);

	/*
	<api>
	<class>Graphics</class>
	<method>drawLine</method>
	<java>void drawLine(int x1,int y1,int x2,int y2,int mode)</java>
	<cpp>virtual void drawLine(int x1,int y1,int x2,int y2,int mode)</cpp>
	<descr>
	<p>Draw a line from x1/y1 to x2/y2. The mode depends on the implementation. When mode is set to ERASE, the line is drawn in "erase mode". If mode==0, it is drawn using the current color. The ERASE feature may not be available on some platforms.</p>
	</descr>
	</api>
	*/
	virtual void drawLine(int x1,int y1,int x2,int y2,int mode);

	/*
	<api>
	<class>Graphics</class>
	<method>drawRectangle</method>
	<java>void drawRectangle(int x,int y,int width,int height,int mode, int style=0)</java>
	<cpp>virtual void drawRectangle(int x,int y,int width,int height,int mode)</cpp>
	<descr>
	<p>Draws a rectangle in the graphics. When mode is set to ERASE, the rectangle is drawn in "erase mode". If mode==0, it is drawn using the current color. The ERASE feature may not be available on some platforms.</p>
	</descr>
	</api>
	*/
	virtual void drawRectangle(int x,int y,int width,int height,int mode=0, int style=0);

	/*
	<api>
	<class>Graphics</class>
	<method>setFont</method>
	<java>void setFont(int style,int height,String fontName)</java>
	<cpp>virtual void setFont(int style,int height,unsigned char* fontName)</cpp>
	<descr>
	<p>Sets the font for the current Graphics. Note that font support is platform-dependent.</p>
	<p>	Available values for style in JAVA are: BOLD, ITALIC</p>
	<p>	height is the font's size</p>
	<p>	fontName is the font's name</p>
	</descr>
	<notes>
	<p>Note that setFont resets the font's color to the default one when it is called.</p>
	</notes>
	</api>
	*/
	virtual void setFont(unsigned char* newFont) ;

	/*
	* Sets newFont as the current font. 
	* In the default implementation, style and height args are NOT used  
	*/
	virtual void setFont(int style, int height, unsigned char* newFont);

	/*
	* Sets the color of the next strings to render.
	*/
	virtual void setTextColor(unsigned char tR,unsigned char tG,unsigned char tB,unsigned char tA);
	virtual void setTextColor(unsigned char tR,unsigned char tG,unsigned char tB)
		{
		setTextColor(tR, tG, tB, 0xff);
		return;
		}

	/*
	<api>
	<class>Graphics</class>
	<method>setTextColor</method>
	<java>int setTextColor(int color)</java>
	<cpp>virtual void setTextColor(unsigned char tRed, unsigned char tGreen, unsigned tBlue)</cpp>
	<p>or </p>
	<cpp>virtual void setTextColor(unsigned int iARGB)</cpp>
	<descr>
	<p>Selects the color used to render text (and the drawings in Java). The Java version of this method returns the color that was set previously.</p>
	</descr>
	</api>
	*/
	virtual void setTextColor(unsigned int tARGB);


	/*
	* Returns the height of a string when it's displayed using the current
	* font.
	*/
	virtual int getHeight(unsigned char* s);

	/*
	* Returns the width of a string when it's displayed using the current
	* font.
	*/
	virtual int getWidth(unsigned char* s);

	/*
	* Render the string s on the current surface, using the current mode.
	* x/y is the upper-left corner of the box where the string must be
	* rendered into.
	* In some implementation, the mode may be included in the bitmap
	* font itself.
	*/
	virtual void drawString(unsigned char* s,int x,int y,int mode=0) ;

	/*
	<api>
	<class>Graphics</class>
	<method>drawString</method>
	<java>void drawString(String string, int x, int y)</java>
	<cpp>virtual void drawString(char* string, int x, int y)</cpp>
	<descr>
	<p>Draws a string into the current graphics using the current font.
	This method is similar to the previous one (that it uses), but it only 
	draws the part of the string where x>0, in a zone whose maximum width
	is maxWidth.
	NOTE: that default version is using ASCII strings, not UTF ones.
	</p>
	</descr>
	</api>

	*/
	virtual void drawString(unsigned char* s ,int x,int y,int mode, int maxWidth) ;

	/*
	<api>
	<class>Graphics</class>
	<method>setAlpha</method>
	<java></java>
	<cpp>virtual void setAlpha(int alpha)</cpp>
	<descr>
	<p>Sets a global alpha value (0=transparent, 254=opaque) to the current surface. This feature may not be available on some platforms.</p>
	</descr>
	</api>
	*/
	virtual void setAlpha(unsigned char newAlpha) ;

	/*
	* Get the global alpha value (0=transparent, 255=opaque) to the 
	* current surface.
	*/
	virtual unsigned char getAlpha() 
	{ return alpha; }

	/*
	* Creates a new graphics containing a reduced version of the current
	* content.
	* Note: a non-toolkit-dependent version of this version is provided 
	* here.
	*/
	virtual Graphics* reduce(int dstWidth, int dstHeight, Graphics* toImg=NULL) ;

	/*
	* Creates a new graphics containing an enlarged version of the current
	* content.
	* Note: a non-toolkit-dependent version of this version is provided 
	* here.
	*/
	virtual Graphics* enlarge(int dstWidth, int dstHeight, Graphics* toImg=NULL) ;

	/*
	* Creates a new graphics containing a resized version of the current
	* content.
	* Note: NO non-toolkit-dependent version of this version is provided 
	* here.
	*/
	virtual Graphics* resize(int dstWidth, int dstHeight, Graphics* toImg=NULL);


	/*
	* Creates a new graphics containing an extraction of the current
	* content.
	* Note: a non-toolkit-dependent version of this version is provided 
	* here.
	*/
	virtual Graphics* extract(int x, int y, int w, int h, Graphics* toImg=NULL) ;

	/*
	* Creates a new graphics containing a vertically flipped version
	* of the current content.
	* Note: a non-toolkit-dependent version of this version is provided 
	* here. Its allows to use the same source and target, cool.
	*/
	virtual Graphics* vflip(Graphics* toImg=NULL) ;

	/*
	* Creates a new graphics containing a horizontally flipped version
	* of the current content.
	* Note: a non-toolkit-dependent version of this version is provided 
	* here. Its allows to use the same source and target, cool.
	*/
	virtual Graphics* hflip(Graphics* toImg=NULL) ;

	/*
	* Allows to know the color channels' coding.
	* Some macros may be used to analyze the result.
	*/
	unsigned long getChannelCoding()
	{ return (surfaceDesc&PIXFORMAT_CHANNELDESC) ; }

	/*
	*
	*/
	static Graphics* getImageG(GContext* gContext, unsigned char* src);
	/*
	*
	*/
	static void freeImageG(GContext* gContext, Graphics* img);

	/*
	* Return the size of the buffers contained in the objet (offscreen buffer, palettes,...)
	* This method is used by the cache managers to optimize the caching processes.
	*/
	virtual int getBuffersSize(void)
	{ return 0; }

} ;

#endif // ndef __EB_GRAPHICS__

⌨️ 快捷键说明

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