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

📄 bbgui.h

📁 DOS平台下一个短消息发送示范程序
💻 H
📖 第 1 页 / 共 2 页
字号:
	
	#define GuiBmpScale(width0,height0,width1,height1,pbmp0,pbmp1) LcdBmpScale(height0,width0,height1,width1,pbmp0,pbmp1)//位图缩放
#else			//正常模式
	#define GUI_WIDTH LCD_WIDTH
	#define GUI_HIGTH LCD_HIGTH

	#define GuiPixel(x,y,color) LcdPixel(x,y,color)		//画像素
	#define GuiPixelXor(x,y,color) LcdPixelXor(x,y,color)	//xor画像素
	#define GuiPixelOr(x,y,color) LcdPixelOr(x,y,color)	//or画像素
	#define GuiPixelAnd(x,y,color) LcdPixelAnd(x,y,color)	//and画像素
	#define GuiPixelNot(x,y) LcdPixelNot(x,y)	//not画像素	
	
	#define GuiPixelRead(x,y) LcdPixelRead(x,y)		//读像素

	#define GuiBox(left,top,right,bottom,color) GuiBoxLine(left,top,right,bottom,color)		//画矩形
	#define GuiBoxXor(left,top,right,bottom,color) GuiBoxLineXor(left,top,right,bottom,color)	//xor画矩形
	#define GuiBoxOr(left,top,right,bottom,color) GuiBoxLineOr(left,top,right,bottom,color)		//or画矩形
	#define GuiBoxAnd(left,top,right,bottom,color) GuiBoxLineAnd(left,top,right,bottom,color)	//and画矩形
	#define GuiBoxNot(left,top,right,bottom) GuiBoxLineNot(left,top,right,bottom)	//not画矩形	
	
	#define GuiCircle(x0,y0,r,color) GuiCirclePixel(x0,y0,r,color)//画圆

	#ifdef LCD_LINE	//使用优化画线函数
		#define GuiLine(x0,y0,x1,y1,color) LcdLine(x0,y0,x1,y1,color)		//画线
		#define GuiLineXor(x0,y0,x1,y1,color) LcdLineXor(x0,y0,x1,y1,color)	//xor画线
		#define GuiLineOr(x0,y0,x1,y1,color) LcdLineOr(x0,y0,x1,y1,color)	//or画线
		#define GuiLineAnd(x0,y0,x1,y1,color) LcdLineAnd(x0,y0,x1,y1,color)	//and画线
		#define GuiLineNot(x0,y0,x1,y1) LcdLineNot(x0,y0,x1,y1)	//not画线
		
		#define GuiLineDot(x0,y0,x1,y1,color) LcdLineDot(x0,y0,x1,y1,color)	//画虚直线
		#define GuiLineXorDot(x0,y0,x1,y1,color) LcdLineXorDot(x0,y0,x1,y1,color)	//xor画虚直线
		#define GuiLineOrDot(x0,y0,x1,y1,color) LcdLineOrDot(x0,y0,x1,y1,color)	//or画虚直线
		#define GuiLineAndDot(x0,y0,x1,y1,color) LcdLineAndDot(x0,y0,x1,y1,color)	//and画虚直线
		#define GuiLineNotDot(x0,y0,x1,y1) LcdLineNotDot(x0,y0,x1,y1)	//not画虚直线
	#else		//使用画点功能的画线函数
		#define GuiLine(x0,y0,x1,y1,color) GuiLinePixel(x0,y0,x1,y1,color)	//画线
		#define GuiLineXor(x0,y0,x1,y1,color) GuiLinePixelXor(x0,y0,x1,y1,color)//xor画线
		#define GuiLineOr(x0,y0,x1,y1,color) GuiLinePixelOr(x0,y0,x1,y1,color)	//or画线
		#define GuiLineAnd(x0,y0,x1,y1,color) GuiLinePixelAnd(x0,y0,x1,y1,color)//and画线
		#define GuiLineNot(x0,y0,x1,y1) GuiLinePixelNot(x0,y0,x1,y1)//not画线
	#endif


	#ifdef LCD_FILL //使用优化填充函数
		#ifdef LCD_BURST //使用硬件加速填充
			#define GuiBoxFill(left,top,right,bottom,color) LcdBoxFillBurst16(left,top,right,bottom,color)	//画填充矩形
		#else
			#define GuiBoxFill(left,top,right,bottom,color) LcdBoxFill(left,top,right,bottom,color)	//画填充矩形
		#endif
		
		#define GuiBoxFillXor(left,top,right,bottom,color) LcdBoxFillXor(left,top,right,bottom,color)	//xor画填充矩形
		#define GuiBoxFillOr(left,top,right,bottom,color) LcdBoxFillOr(left,top,right,bottom,color)	//or画填充矩形
		#define GuiBoxFillAnd(left,top,right,bottom,color) LcdBoxFillAnd(left,top,right,bottom,color)	//and画填充矩形
		#define GuiBoxFillNot(left,top,right,bottom) LcdBoxFillNot(left,top,right,bottom)	//not画填充矩形

	#else
		#define GuiBoxFill(left,top,right,bottom,color) GuiBoxFillPixel(left,top,right,bottom,color)		//画填充矩形
		#define GuiBoxFillXor(left,top,right,bottom,color) GuiBoxFillPixelXor(left,top,right,bottom,color)	//xor画填充矩形
		#define GuiBoxFillOr(left,top,right,bottom,color) GuiBoxFillPixelOr(left,top,right,bottom,color)	//or画填充矩形
		#define GuiBoxFillAnd(left,top,right,bottom,color) GuiBoxFillPixelAnd(left,top,right,bottom,color)	//and画填充矩形
		#define GuiBoxFillNot(left,top,right,bottom) GuiBoxFillPixelNot(left,top,right,bottom)	//not画填充矩形
	#endif
	
	#define GuiAreaFill(xseed,yseed,bordercolr,fillcolr ) LcdAreaFill(xseed,yseed,bordercolr,fillcolr );//填充指定色彩边框区域
	#define GuiFillColor(xseed,yseed,oldcolr,newcolr ) LcdFillColor(xseed,yseed,oldcolr,newcolr );//填充指定色彩区域

	#ifdef LCD_BMP //使用优化位图函数
		#define GuiBmpRead(left,top,right,bottom,pbmp) LcdBmpRead(left,top,right,bottom,pbmp)	//读位图
		
		#define GuiBmp(left,top,right,bottom,pbmp) LcdBmp(left,top,right,bottom,pbmp)		//画位图
		#define GuiBmpFloat(left,top,right,bottom,pbmp,bkcolor) LcdBmpFloat(left,top,right,bottom,pbmp,bkcolor)//画浮动位图
		#define GuiBmpXor(left,top,right,bottom,pbmp) LcdBmpXor(left,top,right,bottom,pbmp)	//xor画位图
		#define GuiBmpOr(left,top,right,bottom,pbmp) LcdBmpOr(left,top,right,bottom,pbmp)	//or画位图
		#define GuiBmpAnd(left,top,right,bottom,pbmp) LcdBmpAnd(left,top,right,bottom,pbmp)	//and画位图
		#define GuiBmpNot(left,top,right,bottom) LcdBmpNot(left,top,right,bottom)	//not画位图
	#else
		#define GuiBmpRead(left,top,right,bottom,pbmp) GuiBmpPixelRead(left,top,right,bottom,pbmp)	//读位图
		
		#define GuiBmp(left,top,right,bottom,pbmp) GuiBmpPixel(left,top,right,bottom,pbmp)	//画位图
		#define GuiBmpXor(left,top,right,bottom,pbmp) GuiBmpPixelXor(left,top,right,bottom,pbmp)//xor画位图
		#define GuiBmpOr(left,top,right,bottom,pbmp) GuiBmpPixelOr(left,top,right,bottom,pbmp)	//or画位图
		#define GuiBmpAnd(left,top,right,bottom,pbmp) GuiBmpPixelAnd(left,top,right,bottom,pbmp)//and画位图
		#define GuiBmpNot(left,top,right,bottom) GuiBmpPixelNot(left,top,right,bottom)//not画位图
		
	#endif
	#define GuiBmpScale(width0,height0,width1,height1,pbmp0,pbmp1) LcdBmpScale(width0,height0,width1,height1,pbmp0,pbmp1)//位图缩放
#endif

#ifdef GUI_CHAR_BMP //有优化字符函数
	#define GuiChar(x0,y0,pText,color,colorBk) GuiCharBmp(x0,y0,pText,color,colorBk)	//快速显示字符
	#define GuiCharUser(x,y,width,height,pDotsBuf,pBmpBuf,color,colorBk) GuiCharUserBmp(x,y,width,height,pDotsBuf,pBmpBuf,color,colorBk)//快速显示用户自定义字符
	#define GuiCharFloat(x0,y0,pText,color) GuiCharBmpFloat(x0,y0,pText,color)	//快速显示浮动字符
	#define GuiCharXor(x0,y0,pText,color,colorBk) GuiCharBmpXor(x0,y0,pText,color,colorBk)	//xor快速显示字符
	#define GuiCharOr(x0,y0,pText,color,colorBk) GuiCharBmpOr(x0,y0,pText,color,colorBk)	//or快速显示字符
	#define GuiCharAnd(x0,y0,pText,color,colorBk) GuiCharBmpAnd(x0,y0,pText,color,colorBk)	//and快速显示字符
	#define GuiCharNot(x0,y0,pText) GuiCharBmpNot(x0,y0,pText)	//not快速显示字符
#else
	#define GuiChar(x0,y0,pText,color,colorBk) GuiCharPixel(x0,y0,pText,color,colorBk)	//调用画点函数显示字符
	#define GuiCharXor(x0,y0,pText,color,colorBk) GuiCharPixelXor(x0,y0,pText,color,colorBk)//xor调用画点函数显示字符
	#define GuiCharOr(x0,y0,pText,color,colorBk) GuiCharPixelOr(x0,y0,pText,color,colorBk)	//or调用画点函数显示字符
	#define GuiCharAnd(x0,y0,pText,color,colorBk) GuiCharPixelAnd(x0,y0,pText,color,colorBk)//and调用画点函数显示字符
	#define GuiCharNot(x0,y0,pText) GuiCharPixelNot(x0,y0,pText)//not调用画点函数显示字符
	#define GuiCharFloat(x0,y0,pText,color) GuiCharPixelFloat(x0,y0,pText,color)	//快速显示浮动字符
#endif

#define GuiString(x,y,pString,color,colorBk) GuiString0(x,y,pString,color,colorBk)	//显示字符串	
#define GuiStringFloat(x,y,pString,color) GuiString0Float(x,y,pString,color)	//显示浮动字符串
#define GuiStringXor(x,y,pString,color,colorBk) GuiString0Xor(x,y,pString,color,colorBk)//xor显示字符串
#define GuiStringOr(x,y,pString,color,colorBk) GuiString0Or(x,y,pString,color,colorBk)	//or显示字符串
#define GuiStringAnd(x,y,pString,color,colorBk) GuiString0And(x,y,pString,color,colorBk)//and显示字符串
#define GuiStringNot(x,y,pString) GuiString0Not(x,y,pString)//not显示字符串

#define GuiCharBig(x0,y0,pText,color,colorBk,xScale,yScale) GuiCharBigPixel(x0,y0,pText,color,colorBk,xScale,yScale)
#define GuiStringBig(x,y,pString,color,colorBk,xScale,yScale) GuiStringBig0(x,y,pString,color,colorBk,xScale,yScale)//显示大字符串	
#define GuiTrend(y,ploopbuf) LcdTrend(y,ploopbuf)	//显示趋势图


/******************GUI内部函数********************/
void GuiLinePixel(int left,int top,int right,int bottom,char color);	//使用画点功能的画线函数void GuiLinePixelXor(int left,int top,int right,int bottom,char color);	//xor使用画点功能的画线函数
void GuiLinePixelOr(int left,int top,int right,int bottom,char color);	//or使用画点功能的画线函数
void GuiLinePixelAnd(int left,int top,int right,int bottom,char color);	//and使用画点功能的画线函数
void GuiLinePixelNot(int left,int top,int right,int bottom);	//not使用画点功能的画线函数

void GuiBoxLine(int left,int top,int right,int bottom,char color);	//使用画线功能的画矩形函数
void GuiBoxLineXor(int left,int top,int right,int bottom,char color);	//xor使用画线功能的画矩形函数
void GuiBoxLineOr(int left,int top,int right,int bottom,char color);	//or使用画线功能的画矩形函数
void GuiBoxLineAnd(int left,int top,int right,int bottom,char color);	//and使用画线功能的画矩形函数
void GuiBoxLineNot(int left,int top,int right,int bottom);	//not使用画线功能的画矩形函数

void GuiCharBmp(int *x,int *y,unsigned char far *Text,char color,char colorBk);	//使用位图函数快速显示字符
void GuiCharUserBmp(int x,int y,int width,int height,unsigned char far *pDotsBuf,char far *pBmpBuf,char color,char colorBk);//快速显示用户自定义字符
void GuiCharBmpFloat(int *x,int *y,unsigned char far *Text,char color);	//使用位图函数快速显示浮动字符
void GuiCharBmpXor(int *x,int *y,unsigned char far *Text,char color,char colorBk);	//xor使用位图函数快速显示字符
void GuiCharBmpOr(int *x,int *y,unsigned char far *Text,char color,char colorBk);	//or使用位图函数快速显示字符
void GuiCharBmpAnd(int *x,int *y,unsigned char far *Text,char color,char colorBk);	//and使用位图函数快速显示字符
void GuiCharBmpNot(int *x,int *y,unsigned char far *Text);	//not使用位图函数快速显示字符

void GuiString0(int x0,int y0,unsigned char far *String,char color,char colorBk);//显示字符串
void GuiString0Float(int x0,int y0,unsigned char far *String,char color);//显示浮动字符串
void GuiString0Xor(int x0,int y0,unsigned char far *String,char color,char colorBk);//xor显示字符串
void GuiString0Or(int x0,int y0,unsigned char far *String,char color,char colorBk);//or显示字符串
void GuiString0And(int x0,int y0,unsigned char far *String,char color,char colorBk);//and显示字符串
void GuiString0Not(int x0,int y0,unsigned char far *String);//not显示字符串

void GuiBmpPixelRead(int left,int top,int right,int bottom,char far *bmp);	//读位图

void GuiBmpPixel(int left,int top,int right,int bottom,char far *bmp);		//调用画点函数画位图
void GuiBmpPixelXor(int left,int top,int right,int bottom,char far *bmp);	//xor调用画点函数画位图
void GuiBmpPixelOr(int left,int top,int right,int bottom,char far *bmp);	//or调用画点函数画位图
void GuiBmpPixelAnd(int left,int top,int right,int bottom,char far *bmp);	//and调用画点函数画位图
void GuiBmpPixelNot(int left,int top,int right,int bottom,char far *bmp);	//not调用画点函数画位图

void GuiCirclePixel(int x0,int y0,int r,char color);	//画圆

void GuiBoxFillPixel(int left,int top,int right,int bottom,char color);		//画填充矩形
void GuiBoxFillPixelXor(int left,int top,int right,int bottom,char color);	//xor画填充矩形
void GuiBoxFillPixelOr(int left,int top,int right,int bottom,char color);	//or画填充矩形
void GuiBoxFillPixelAnd(int left,int top,int right,int bottom,char color);	//and画填充矩形
void GuiBoxFillPixelNot(int left,int top,int right,int bottom);	//not画填充矩形

void GuiCharPixel(int *x0,int *y0,unsigned char far *Text,char color,char colorBk);	//调用画点函数显示字符
void GuiCharPixelXor(int *x0,int *y0,unsigned char far *Text,char color,char colorBk);	//xor调用画点函数显示字符
void GuiCharPixelOr(int *x0,int *y0,unsigned char far *Text,char color,char colorBk);	//or调用画点函数显示字符
void GuiCharPixelAnd(int *x0,int *y0,unsigned char far *Text,char color,char colorBk);	//and调用画点函数显示字符
void GuiCharPixelNot(int *x0,int *y0,unsigned char far *Text);	//not调用画点函数显示字符
void GuiCharPixelFloat(int *x,int *y,unsigned char far *Text,char color);	//

/******************GUI用户可使用函数********************/
void GuiInit(void);//初始化
void GuiCharPixelV(int *x,int *y,unsigned char far *Text,char color,char colorBk);//旋转90度显示字符
void GuiCharBigPixel(int *x,int *y,unsigned char far *Text,char color,char colorBk,int xScale,int yScale);//显示大字符
void GuiStringBig0(int x,int y,unsigned char far *String,char color,char colorBk,int xScale,int yScale);//显示大字符串
void GuiStringMem(int *x,int *y,unsigned char far *String,char far *pBmpBuf,char color,char colorBk);//字符写入内存


#endif  /* __GUI_H */

#ifdef __cplusplus                                                    
}                                                                     
#endif        

⌨️ 快捷键说明

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