ImageVerifierCode 换一换
格式:DOCX , 页数:48 ,大小:27.82KB ,
资源ID:8244565      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-8244565.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(24寸TFT彩屏 430例程 GUI函数部分Word格式文档下载.docx)为本站会员(b****4)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

24寸TFT彩屏 430例程 GUI函数部分Word格式文档下载.docx

1、/显示1位16进制数void GUI_HLine(uchar x, uint y, uchar length, uint color);/画横线void GUI_RLine(uchar x, uint y, uint high, uint color);/画竖线void GUI_line(uint x1,uint y1,uint x2,uint y2,uint color);/画直线void GUI_DisPicture(uchar x, uint y, uchar length, uint high);/显示图片(图标)void GUI_sprintf_char(uchar x, uint

2、y,uchar c, uint color,uint b_color);/显示英文或数字字符void GUI_sprintf_string(uchar x, uint y,char *s, uint color,uint b_color);/显示英文字符串void GUI_sprintf_HZ(uchar x, uint y, uint color,uint b_color);/显示预定义汉字字符串void GUI_box(uchar sx,uint sy,uchar ex,uint ey,uint color);/画实心矩形void GUI_rectangle( uchar sx,uint

3、sy,uchar ex,uint ey,uint color);/画空心矩形void GUI_wrul(uchar x, uint y, unsigned long num, uint color,uint b_color);/以十进制形式显示无符号长整型数void GUI_wrlval(uchar x, uint y,unsigned long num,uchar bits,uchar dp,uint color,uint b_color);/以十进制形式显示长变量uint RGB(uchar R,uchar G,uchar B);/RGB颜色混合/*定义常用颜色的颜色码*/#define

4、RED 0xf800 /红#define YELLOW 0xffe0 /黄#define GREEN 0x07e0 /绿#define CYAN 0x07ff /青#define BLUE 0x001f /蓝#define PURPLE 0xf81f /紫#define BLACK 0x0000 /黑#define WHITE 0xffff /白#define GRAY 0x7bef /灰GUI函数程序.c文件 GUI.c#include gui.h16x8.hchinese.hbmp.h/*清屏入口参数: b_color是背景颜色。出口参数: 无说明:使用背景颜色清除TFT模块屏幕的全部显示

5、内容。*/void GUI_clearscreen(uint b_color) uint i,j; LCD_CS_L; /打开片选使能 Address_set(0,0,239,319); for (i=0;i320;i+) for(j=0;ji)=(0x80i) GUI_sprintf_nu(x,y,1,color,b_color) ; else GUI_sprintf_nu(x,y,0,color,b_color) ; x+=8 ;无符号字符型数以十六进制形式显示(x,y)是显示内容的左上角坐标,dat 是欲显示的无符号字符型数, color 是显示字符的颜色,b_color是背景颜色。 以

6、十六进制形式显示出来。void GUI_sprintf_chartohex(uchar x, uint y,uchar dat, uint color,uint b_color) GUI_sprintf_nu(x,y,dat4,color,b_color) ; x+=8 ; GUI_sprintf_nu(x,y,dat&0x0f,color,b_color) ;无符号字符型数以十进制形式显示(x,y)是显示内容的左上角坐标,dat是欲显示的无符号字符型数, 以十进制形式显示出来。void GUI_sprintf_chartodec(uchar x,uint y,uchar dat,uint c

7、olor,uint b_color) GUI_sprintf_char(x,y,dat/100+0,color,b_color); GUI_sprintf_char(x+8,y,dat/10%10+ GUI_sprintf_char(x+16,y,dat%10+显示1位16进制数 (x,y) 是显示内容的左上角坐标,c:欲显示的1位16进制数,color:颜色,b_color:背景颜色。用指定位置上显示1位16进制数。/*void GUI_sprintf_nu(uchar x, uint y,uchar nu, uint color,uint b_color) uchar s_x=0 ,s_y

8、=0, temp=0 ; uint j; if (nu9) nu=nu+7; nu=nu+16; for(s_y=0;s_y16;s_y+) if(s_y+y320) j=nu; j=j*16+s_y; temp=font16x8j; /temp = font16x8nu*16+s_y ; for( s_x=0 ; s_x8 ; s_x+ ) if(x+s_x(s_x) ) GUI_Point(x+s_x, y+s_y,color) ; else GUI_Point(x+s_x, y+s_y,b_color) ; */画横线 (x,y)是横线起点坐标,length是横线长度,color 是横线

9、颜色。用指定的颜色在指定位置上画出指定长度的一条横线。void GUI_HLine(uchar x, uint y, uchar length, uint color) Address_set(x,y,x+length-1,y); do write_data_u16(color);/逐点显示,描出水平线 length-; while(length);画竖线 (x,y)是竖线起点坐标,high 竖线高度,color 是竖线颜色。用指定的颜色在指定位置上画出指定长度的一条竖线。void GUI_RLine(uchar x, uint y, uint high, uint color) Addres

10、s_set(x,y,x,y+high-1);/ 逐点显示,描出垂直线 high-; while(high); /* 画直线(可以画任意方向直线,包括横线、竖线、斜线)。 (x1,y1)起点, (x2,y2)终点, color颜色。用指定的颜色在指定的两点间画出一条直线。*/void GUI_line(uint x1,uint y1,uint x2,uint y2,uint color) uint t; int xerr=0,yerr=0,delta_x,delta_y,distance; int incx,incy; uint row,col; delta_x = x2-x1;/计算坐标增量

11、delta_y = y2-y1; col=x1; row=y1; if(delta_x0) incx=1;/设置单步方向 else if(delta_x=0) incx=0;/垂直线 else incx=-1;delta_x=-delta_x; if(delta_y0)incy=1; if(delta_y=0) incy=0;/水平线 else incy=-1;delta_y=-delta_y;delta_y) distance=delta_x;/选取基本增量坐标轴 else distance=delta_y; for(t=0;tdistance) xerr-=distance; col+=i

12、ncx; if(yerr yerr-=distance; row+=incy;显示图片(图标)(x,y)是开始点的坐标,length是图片长度,high是图片高度。/pic 图片数组的指针用指定位置上显示事先定义的图片。要显示的图片事先定义在bmp.h中的pic数组中,如果想修改图片大小、内容,请修改bmp.h中的pic数组,建议用Image2Lcd软件将你要显示的图象自动转换为数组数据。/void GUI_DisPicture(uchar x, uint y, uchar length, uint high ,const uchar *pic)void GUI_DisPicture(ucha

13、r x, uint y, uchar length, uint high) uint temp=0,tmp=0,num=0; Address_set(x,y,x+length-1,y+high-1); num=length*high*2; /temp=pictmp|( pictmp+18); temp=pictmp+1; temp=temp temp=temp|pictmp; write_data_u16(temp);/逐点显示 tmp+=2; while(tmpnum);显示英文或数字字符(x,y) 是显示内容的左上角坐标,c:显示的英文字符, color:用指定位置上显示单个英文字符或数字

14、字符。void GUI_sprintf_char(uchar x, uint y,uchar c, uint color,uint b_color) uchar s_x ,s_y, temp ; c -= 32; for( s_y=0 ; s_y 16 ; s_y+ ) j=c; /temp = font16x8c*16+s_y ;显示英文字符串(x,y) 是显示内容的左上角坐标,*s:英文字符串指针,在指定位置上显示英文字符串。void GUI_sprintf_string(uchar x, uint y,char *s, uint color,uint b_color) for(;*s!=

15、0;s+) GUI_sprintf_char(x, y,*s, color,b_color); x=x+8; /while (*s) / / GUI_sprintf_char(x, y,*s, color,b_color); / s+; / x=x+8; / 显示预定义汉字字符串(x,y) 是显示内容的左上角坐标,color:在指定位置上显示预定义的中文字符串。 要显示的中文字符串事先定义在chinese.h中的china_char数组中, 如果想修改中文字符串长度、内容,请修改chinese.h中的 china_char数组,建议用字模提取软件zimoV2.2将你要显示的 中文字符串自动转换为数组数据。void GUI_sprintf_HZ(uchar x, uint y, uint color,uint b_color) uchar s_x=0 ,s_y=0, temp=0 ; uchar n; uint j,words; words=sizeof(china_char)/32; for( n=0 ; nwords ; n+ )16 ; s_x+ ) if(s_x+x j=n; j=j*32+s_x; temp = china_charj ; /temp = china_charn*32+s_x ; for( s_y=0 ; s_y if(y+s_y(s_y) )

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2