#include "gui.h" #include "lcdDrv.h" #include "lsapi_fs.h" #include "log.h" #include "fonts.h" #include "board.h" #include "uiEntry.h" #include "app.h" #define COLOR_BACKGROUND COLOR_WHITE #define COLOR_FOREGROUND COLOR_BLUE unsigned char g_aucLcdBufF[GLCD_HEIGHT/8][GLCD_WIDTH]; unsigned int g_backColor; unsigned int g_foreColor; unsigned int guiGetBackColor(void){return g_backColor;} unsigned int guiGetForeColor(void){return g_foreColor;} void LcdSetAddr(unsigned char x, unsigned char Page) { LCD_CtrlWrite_ST7735(0xB0+Page); LCD_CtrlWrite_ST7735(0x10+((x>>4)&0x0f)); LCD_CtrlWrite_ST7735(x&0x0f); } void LCDFlashPain(void){ unsigned char i,j; for(i=0;iROW_FOUR) return; j=2*row; for(i=x;i> (16+3))&0x1F; g=(rgb888 >> (8+2))&0x3f; r=(rgb888 >> (0+3))&0x1f; rgb565=((r<<11) + (g<<5) + (b<<0)); return rgb565; } static void guiDrawDot(unsigned short colorData){ LCD_DataWrite_ST7735(colorData >> 8); LCD_DataWrite_ST7735(colorData & 0xff); } static void guiBlockSet(unsigned short sx, unsigned short ex, unsigned short sy, unsigned short ey){ LCD_CtrlWrite_ST7735(0x2a); guiDrawDot(sx); guiDrawDot(sy); LCD_CtrlWrite_ST7735(0x2B); guiDrawDot(ex); guiDrawDot(ey); LCD_CtrlWrite_ST7735(0x2C); } #define KEEP_HZK_OPENED //ê?·?±£3????t3£?a static int guiGetHzk(unsigned char hiByte, unsigned char loByte, unsigned char *pHzk, FONT_MODEENUM fontMode){ unsigned char Q,W; unsigned int offset; const char hzk_12x12[]="HZK12"; const char hzk_16x16[]="HZK16"; char *hzk_ptr=NULL; static int fd_12=NULL,fd_16=NULL; int *fd_ptr=NULL; int fsize; if(hiByte<0xa0 || loByte<0xa0) return -1; Q=hiByte-0xa0; W=loByte-0xa0; if(FONT_MODE_12X12==fontMode){ fsize = 24; hzk_ptr=(char *)hzk_12x12; fd_ptr=&fd_12; }else if(FONT_MODE_16X16==fontMode){ fsize = 32; hzk_ptr=(char *)hzk_16x16; fd_ptr=&fd_16; }else return -2; offset=(94 * (Q-1) + (W-1))* fsize; //′ò?a???t if(*fd_ptr==NULL){ int fd=LSAPI_FS_Open(hzk_ptr, LSAPI_FS_O_RDONLY, 0); if(fd==NULL){ MSG_ERR(1, "%s open failed", hzk_ptr); return -3; } *fd_ptr=fd; } //?áè??úèY LSAPI_FS_Seek(*fd_ptr, offset, LSAPI_FS_SEEK_SET); offset=LSAPI_FS_Read(*fd_ptr, pHzk,fsize); #ifndef KEEP_HZK_OPENED LSAPI_FS_Close(*fd_ptr); *fd_ptr=NULL; #endif return offset; } static int fd_12_ext=NULL,fd_16_ext=NULL; static int extFileSize_1212=-1; static int extFileSize_1616=-1; bool fontExtLock=false; void extFontFileCtl(unsigned char fontType,bool ctl){ int *fd_ext; if(ctl==true) fontExtLock=false; else{ fontExtLock=true; if(fontType==12) fd_ext=&fd_12_ext; else if(fontType==16) fd_ext=&fd_16_ext; else{ fontExtLock=false; return; } if(*fd_ext != NULL){ LSAPI_FS_Close(*fd_ext); *fd_ext=NULL; } } } static int guiGetExtHzk(unsigned char hiByte, unsigned char loByte, unsigned char *pHzk, FONT_MODEENUM fontMode){ unsigned char Q,W; int offset,i; char *hzk_ptr=NULL; int *fd_ptr=NULL; int *fsize,rsize; LSAPI_FS_Stat_info_t pBuf; unsigned char tmp[2+32]; if(fontExtLock==true) return -1; if(FONT_MODE_12X12==fontMode){ rsize = 24+2; hzk_ptr=HZK_12_NEW_FILE; fd_ptr=&fd_12_ext; fsize=&extFileSize_1212; }else if(FONT_MODE_16X16==fontMode){ rsize = 32+2; hzk_ptr=HZK_16_NEW_FILE; fd_ptr=&fd_16_ext; fsize=&extFileSize_1616; }else return -2; //′ò?a???t if(*fd_ptr==NULL){ int fd=LSAPI_FS_Open(hzk_ptr, LSAPI_FS_O_RDONLY, 0); if(fd==NULL){ MSG_ERR(1, "%s open failed", hzk_ptr); return -3; } *fd_ptr=fd; } //get file size if(*fsize<1){ memset(&pBuf,0,sizeof(pBuf)); LSAPI_FS_Fstat(*fd_ptr,&pBuf); *fsize=pBuf.st_size; if(*fsize<0){ offset=-4; goto F_END; } } LSAPI_FS_Seek(*fd_ptr, 0, LSAPI_FS_SEEK_SET); //check size if(1!=LSAPI_FS_Read(*fd_ptr, tmp,1)){ offset=-5; goto F_END; } if(FONT_MODE_12X12==fontMode && tmp[0]!=12){ offset=-6; goto F_END; }else if(FONT_MODE_16X16==fontMode && tmp[0]!=16){ offset=-7; goto F_END; } for(;;){ offset=LSAPI_FS_Read(*fd_ptr, tmp,rsize); if(offset != rsize){ offset=-8; goto F_END; } if(tmp[0]==hiByte && tmp[1]==loByte){ offset=rsize-2; memcpy(pHzk, tmp+2, offset); goto F_END; } } offset=-9; F_END: #ifndef KEEP_HZK_OPENED LSAPI_FS_Close(*fd_ptr); *fd_ptr=NULL; #endif return offset; } static void guiShowChars(unsigned short x,unsigned short y,unsigned char hiByte, unsigned char loByte, FONT_MODEENUM fontMode, unsigned int frontColorID,//???? unsigned int backColorID,//???? REV_ENUM rev){//?? unsigned short i,j,k,m,n,fcolor,bcolor; unsigned short width,height; unsigned char ByteWidth,data; const unsigned char *l_pucFont,*l_pucLetter; unsigned char *p; unsigned char sucHzk16[32]; unsigned char sucHzk12[24]; int ret; //===?¨¨?¨′?Y?á??¤?¨|¨¨????¨o?|ì??¨a??é????é|ì??¨?¨oy?Y????|쨨=== x++;y++; k = 0; if(hiByte==0){//english if(fontMode==FONT_MODE_12X12){//8* 12 width=8;//8 height = 12; //12 ByteWidth = 1; l_pucFont = g_apucFonts12; l_pucLetter = g_apucLetter12; }else{ //8*16 width=8; height = 16; ByteWidth = 1; l_pucFont = g_apucFonts16; l_pucLetter = g_apucLetter16; } while(*l_pucLetter){ if(loByte == *l_pucLetter)break; l_pucLetter ++; k ++; } //2¨|?¨°|ì??á??a|ì??a¨o????? l_pucFont += k * ByteWidth * height; }else{//chinese if(fontMode==FONT_MODE_12X12){//12*16 width=16; height = 12; ByteWidth = 2; l_pucFont = sucHzk12; l_pucLetter = 0; k=0; ret=guiGetHzk(hiByte,loByte,sucHzk12,fontMode); if(sizeof(sucHzk12)!=ret) ret=guiGetExtHzk(hiByte, loByte, sucHzk12,fontMode); if(sizeof(sucHzk12)!=ret){//??¨?sFlash|ì?HZK???t?D?¨¢¨¨??á??a¨oy?Y //?¨°2?|ì??á??a?ê???¨o?"?¨2" l_pucFont=g_apucCLetter16; MSG_ERR(1, "guiGetHzk12Err:%02x,%02x,%d",hiByte,loByte,ret); } }else{//16*16 width=16; height = 16; ByteWidth = 2; l_pucFont = sucHzk16; l_pucLetter = 0; k=0; ret=guiGetHzk(hiByte,loByte,sucHzk16,fontMode); if(sizeof(sucHzk16)!=ret) ret=guiGetExtHzk(hiByte, loByte, sucHzk16,fontMode); if(sizeof(sucHzk16)!=ret){//??¨?sFlash|ì?HZK16???t?D?¨¢¨¨??á??a¨oy?Y //?¨°2?|ì??á??a?ê???¨o?"?¨2" l_pucFont=g_apucCLetter16; MSG_ERR(1, "guiGetHzk16Err:%02x,%02x,%d",hiByte,loByte,ret); } } } //====================?¨′??|¨¤¨a|ì??¨?¨oy?Y========== if(y+height>GLCD_HEIGHT)return; if(x+width>GLCD_WIDTH)return; guiBlockSet(x,y,x+width-1,y+height-1);//8,12 fcolor=RGB888_2_RGB565(frontColorID); bcolor=RGB888_2_RGB565(backColorID); //¨°?????à?¨???|ì??¨???é|ì?LCD?ê?2?¨?????????ê¨??¨?¨22a¨o??ê??á?騰a|ì??¨??2?¨°a|ì??¨??PaintBufToLcd?ê??¤??¨°¨°2??é?¨¢¨¢? //?¨′?Y?á???ê?¨2??????D?-|ì? for(j=0;j>k)){//??,??frontColorID if(REVERSED_NO==rev) guiDrawDot(fcolor); else guiDrawDot(bcolor); }else{//??,??backColorID if(REVERSED_NO==rev) guiDrawDot(bcolor); else guiDrawDot(fcolor); } } } } } short guiGetStrXLen(char *str, FONT_MODEENUM fontMode){ unsigned char ch; unsigned short len=0; unsigned char bsize; if(FONT_MODE_12X12==fontMode) bsize=6; else if(FONT_MODE_16X16==fontMode) bsize=8; else return 0; while ((ch=*str++)){ if(ch=='M')len+=12; else if(ch>='A'&&ch<='Z')len+=8; else if(ch>='a'&&ch<='z')len+=8; else if(ch>='0'&&ch<='9')len+=8; else if(ch>=0x20&& ch<=0x60)len+=8; //¨??¨oa?á??¤? else len+=bsize; } return len; } //ò????ó?ú??ía?a·? void guiShowStr(unsigned short x, unsigned short y,const char *string, FONT_MODEENUM fontMode, REV_ENUM rev, //???? unsigned int frontColorID,//??? unsigned int backColorID){//??? unsigned char width1,width2,heigh; unsigned char *p; unsigned short i; if(fontMode == FONT_MODE_12X12){ width1 = 12; width2 = 1; heigh=12; }else if(fontMode == FONT_MODE_16X16){ width1 = 16; width2 = 1; heigh=16; }else return; p = (unsigned char *)string; i = 0; while(*p){ if (*p > 0x80){//chinese letter guiShowChars(x+i,y,*p, *(p+1),fontMode,frontColorID,backColorID,rev); i += width1 ; p += 2; }else{//english letter guiShowChars(x + i,y,0,*p,fontMode,frontColorID,backColorID,rev); if(fontMode==0) i += width2 * 8; else i += width2 * 8; p ++; } } } void guiShowButton(unsigned short x, unsigned short y,const char *str, FONT_MODEENUM fontMode,unsigned int buttonColorID, unsigned int strColorID){ int heigh,len; if(FONT_MODE_12X12==fontMode) heigh=12+4; else if(FONT_MODE_16X16==fontMode) heigh=16+4; else return; len=guiGetStrXLen((char *)str, fontMode); guiFillRect(x,y,x+len+8,y+heigh,buttonColorID); guiShowStr(x+4, y+1, str, fontMode,REVERSED_NO,strColorID,buttonColorID); } void guiFillRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2,unsigned int colorData){ x1++;x2++;y1++;y2++; unsigned short x=x2,y=y2,w,h,i,m,k,j,data; if(x1>x2 || y1>y2) return; if(x1>=GLCD_WIDTH || y1>=GLCD_HEIGHT) return; if(x>GLCD_WIDTH) x=GLCD_WIDTH; if(y>GLCD_HEIGHT) y=GLCD_HEIGHT; w=x-x1+1; h=y-y1+1; data=RGB888_2_RGB565(colorData); guiBlockSet(x1,y1,x,y); for(i=0;ix2||y1>y2) return; guiDrawHLine(x1,x2,y1,width,colorID); guiDrawHLine(x1,x2,y2,width,colorID); guiDrawVLine(y1,y2,x1,width,colorID); guiDrawVLine(y1,y2+width-1,x2,width,colorID); } //óé·??ò?aμ?(x,y)?aê??- void guiDrawArrow(unsigned short x, unsigned short y,unsigned short len, ARROW_ENUM direction, unsigned int colorID){ unsigned short i; switch(direction){ case ARROW_LEFT: for(i=0;i>3; g=G>>2; b=B>>3; RGB565=((r<<11)+(g<<5)+(b<<0)); guiDrawDot(RGB565); } } } int WidthBytes( int nBits, int nWidth ){ int nWidthBytes; nWidthBytes = nWidth; if( nBits == 1 ) nWidthBytes = ( nWidth + 7 ) / 8; else if( nBits == 4 ) nWidthBytes = ( nWidth + 1 ) / 2; else if( nBits == 16 ) nWidthBytes = nWidth * 2; else if( nBits == 24 ) nWidthBytes = nWidth * 3; else if( nBits == 32 ) nWidthBytes = nWidth * 4; while( ( nWidthBytes & 3 ) != 0 ) nWidthBytes++; return( nWidthBytes ); } void guiShowBmp(unsigned short x, unsigned short y, char *bmp){ } #define IMAGE_MAX_SIZE 322 void guiShowBinMap(unsigned short x, unsigned short y, char *bmp){ int fd,filelen; unsigned char temp[IMAGE_MAX_SIZE],round; LSAPI_FS_Stat_info_t pBuf; unsigned short w,h,i,j,page,l,totalPage,leftbits,k,n,d,f,startY,moveBits,totalHDots,index1,index2; fd=LSAPI_FS_Open(bmp, LSAPI_FS_O_RDONLY,0); if(fd<0){ MSG_ERR(1, "%s open failed", bmp); return; } //check file length memset(&pBuf,0,sizeof(pBuf)); LSAPI_FS_Fstat(fd,&pBuf); filelen=pBuf.st_size; if(filelen>IMAGE_MAX_SIZE){ MSG_INFO(1, "%s image too large %d>%d",bmp,filelen,IMAGE_MAX_SIZE); goto BMP_END; } LSAPI_FS_Read(fd, temp, filelen); w=temp[0];//width h=temp[1];//heigh page=y/8;//start page startY=y%8;//draw from startY dot for(i=0;i>= 1; } totalHDots -= moveBits; if(totalHDots <=0) break; //write the second time if(moveBits==8){//é?ò?ò3ê?°′??ì?8dotD′μ? //′?ò3ò2°′??ò3D′ if(totalHDots >= 8) moveBits=8; else moveBits=totalHDots; startY=0; for(n=0;n>= 1; } } else{ moveBits = startY; //5 for(n=0;n>= 1; } } totalHDots -= moveBits; if(totalHDots <=0) break; index1++; index2++; totalPage--; } } //LCDFlashPain(); LCDFlashPainPage(x,y); BMP_END: if(fd>0) LSAPI_FS_Close(fd); } /*?ó?D??ê?*/ void guiShowCaption(unsigned short xType, const char *str, unsigned short y, unsigned int frontColorID, unsigned int backColorID, FONT_MODEENUM fontMode){ int len,sy; unsigned short x; len=guiGetStrXLen((char *)str,fontMode); if(xType==0) x=(GLCD_WIDTH-len)/2; else x=xType; guiShowStr(x, y, str, fontMode, REVERSED_NO, frontColorID, backColorID); } void guiClearArea(unsigned short x, unsigned short y, unsigned short width, unsigned short height,unsigned int colorID){ guiFillRect(x,y,x+width,y+height,colorID); } void newGuiNoteBoot(char type){ const char *p1="正在开机"; const char *p2="请等待"; const char *p3="欢迎使用"; const char *p4="公网集群对讲机"; char *ptr1,*ptr2; if(type==0){ ptr1=p1; ptr2=p2; }else{ ptr1=p3; ptr2=p4; } newGuiClearMainPage(); DrawLineV(0, 8, GLCD_WIDTH); newGuiShowMessageBox(ptr1,ROW_TWO); newGuiShowMessageBox(ptr2,ROW_THREE); } void guiInit(void){ memset(g_aucLcdBufF, 0x00, GLCD_HEIGHT/8*GLCD_WIDTH); // SetMessageConfi(); //if(sutApp.account.tnet==5) guiShowBmp(0,0,"welcome5.bin");//开机图片 //else guiShowBmp(0,0,"welcome.bin");//开机图片 newGuiNoteBoot(0); LCDFlashPain();//刷屏缓存 lcdBackLightApi(1);//清屏后打开,否则会看到关机前的画面 } void guiClearAll(unsigned int colorID){//只清第二,三区 guiFillRect(0, UI_STATUS_ITEM_Y, GLCD_WIDTH-1, UI_CONTENT_SHOW_Y-1, guiGetForeColor());//清除第二区 guiFillRect(0,UI_CONTENT_SHOW_Y,GLCD_WIDTH-1,GLCD_HEIGHT-1,colorID); } void guiShowMessageBox(char *msg){ char buf[70]; short len,x,y; y=GLCD_HEIGHT/2; guiClearRect(0,y-20,GLCD_WIDTH-1,y+20,guiGetBackColor()); guiDrawRect(2,y-18,GLCD_WIDTH-3,y+18,1,COLOR_BLACK); StrIntercept(buf,msg,18); #ifdef USE_12X12_FONT_ONLY len=guiGetStrXLen(buf,FONT_MODE_12X12); x=(GLCD_WIDTH-len)/2; guiShowStr(x,y-6,buf,FONT_MODE_12X12,REVERSED_NO,COLOR_BLACK,guiGetBackColor()); #else len=guiGetStrXLen(buf,FONT_MODE_16X16); x=(GLCD_WIDTH-len)/2; guiShowStr(x,y-8,buf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor()); #endif } //画一条线,线粗为1点 //x,y为纵横坐标 //len为长度 void DrawLineV(unsigned char x, unsigned char y,unsigned char len) { //x 0 - 127 //y 0 - 63 unsigned char i,j,page,l,length; if(len<=1) return; if(x > GLCD_WIDTH) return; if(y > GLCD_HEIGHT) return; page = y/8; l=y%8; length=len; if(length+x > GLCD_WIDTH) length = GLCD_WIDTH-x; for(i=0;i GLCD_WIDTH) return; if(y > GLCD_HEIGHT) return; page = y/8; //第几页 l=y%8; //第几个 totalPage = (height-(8-l))/8; //共几页 if(height > (8-l)) leftbits = (height-(8-l))%8; //尾部位置 else leftbits = 0; hei=height; if(hei+x > GLCD_WIDTH) hei = GLCD_WIDTH-x; // if(height < 8) k = 8-height; else k=l; //printf("page:%d,l:%d,totalPage:%d,leftbits:%d,hei:%d,k:%d\r\n", page,l,totalPage,leftbits,hei,k); for(i=0;i<(8-k);i++) g_aucLcdBufF[page][x] |= (1<<(l+i)); for(i=0;i 0x80)//chinese {//填充2*8=16个点数据 if(font==FONT_MODE_12X12){ ret=GetHzk(*p,*(p+1),sucHzk12,font); if(ret != 24) ret=guiGetExtHzk(*p,*(p+1),sucHzk12,font); if(24!=ret){ //找不到字库,显示"口" memcpy(sucHzk12, g_apucCFonts16, sizeof(sucHzk12)); } Rota90Degreed12(sucHzk12); memcpy(tempBack, &sucHzk12[12],12); memcpy(&sucHzk12[13],tempBack, 12); sucHzk12[12]=0; sucHzk12[25]=0; //////////////////////////////////// h = y % 8;//新page中的第几行 pa = y / 8;//座落于第几page k1 = 8-h;//开始page中有多少位是要被处理的,且处理是高位先 k2 = 12-k1;//下一个page中要显示多少位 if(k2>8) //k3,再下一个page中要显示多少位,对于12高度来说,最多跨三个page { k3=k2-8; k2 = 8; } else k3=0; for(i=0;i<13;i++) { temp = (((unsigned short)sucHzk12[i+13])<<8) & 0xff00; temp |= ((unsigned short)sucHzk12[i])&0xff; for(j=0;j>= 1; } for(j=0;j>= 1; } for(j=0;j>= 1; } } p+=2; charNum += 12+1;//加1是让两个字体间有间隔12*12本身是基本会用完宽度的 }else{ ret=GetHzk(*p,*(p+1),sucHzk16,font); if(ret != 32) ret=guiGetExtHzk(*p,*(p+1),sucHzk16,font); if(32!=ret){ //找不到字库,显示"口" memcpy(sucHzk16, g_apucCFonts16, sizeof(sucHzk16)); } Rota90Degreed16(sucHzk16); //////////////////////////////////// h = y % 8;//新page中的第几行 pa = y / 8;//座落于第几page k1 = 8-h;//开始page中有多少位是要被处理的,且处理是高位先 k2 = 16-k1;//下一个page中要显示多少位 if(k2>8) //k3,再下一个page中要显示多少位 { k3=k2-8; k2 = 8; } else k3=0; for(i=0;i<16;i++) { temp = (((unsigned short)sucHzk16[i+16])<<8) & 0xff00; temp |= ((unsigned short)sucHzk16[i])&0xff; for(j=0;j>= 1; } for(j=0;j>= 1; } for(j=0;j>= 1; } } p+=2; charNum += 16;//加1是让两个字体间有间隔12*12本身是基本会用完宽度的 } }else//english {//填充1*8=8 个点数据 if(font==0){ if(*p < 0x30) tempData = *p-0x20; else if(*p <= '9') tempData = *p-0x30+16; else if(*p <= '@') tempData = *p-0x3a+26; else if(*p <= 'Z') tempData = *p-0x41+33; else if(*p <= 'z') tempData = *p-0x61+59; else if(*p <= '~') tempData = *p-0x7b+85; /////////////////////////// //////////////////////////////////// h = y % 8;//新page中的第几行 pa = y / 8;//座落于第几page k1 = 8-h;//开始page中有多少位是要被处理的,且处理是高位先 k2 = 8-k1;//下一个page中要显示多少位 if(k2>8) //k3,再下一个page中要显示多少位,对于12高度来说,最多跨三个page { k3=k2-8; k2 = 8; } else k3=0; for(i=0;i<8;i++) { temp = (((unsigned short)g_english88[tempData][i+8])<<8) & 0xff00; temp |= ((unsigned short)g_english88[tempData][i])&0xff; for(j=0;j>= 1; } for(j=0;j>= 1; } for(j=0;j>= 1; } } p++; charNum += 8; }else { if(*p < 0x30) tempData = *p-0x20; else if(*p <= '9') tempData = *p-0x30+16; else if(*p <= '@') tempData = *p-0x3a+26; else if(*p <= 'Z') tempData = *p-0x41+33; else if(*p <= 'z') tempData = *p-0x61+59; else if(*p <= '~') tempData = *p-0x7b+85; /////////////////////////// //////////////////////////////////// h = y % 8;//新page中的第几行 pa = y / 8;//座落于第几page k1 = 8-h;//开始page中有多少位是要被处理的,且处理是高位先 k2 = 12-k1;//下一个page中要显示多少位 if(k2>8) //k3,再下一个page中要显示多少位,对于12高度来说,最多跨三个page { k3=k2-8; k2 = 8; } else k3=0; for(i=0;i<8;i++) { temp = (((unsigned short)g_english812[tempData][i+8])<<8) & 0xff00; temp |= ((unsigned short)g_english812[tempData][i])&0xff; for(j=0;j>= 1; } for(j=0;j>= 1; } for(j=0;j>= 1; } } p++; charNum += 8; } } } // LCDFlashPain(); LCDFlashPainPage(X,y); } void NewDrawVLine(unsigned short x, unsigned short y, unsigned short Vlen) { unsigned short i,j,k; unsigned short drawVdots;//需要画紧方向的总dot数 unsigned short leftdots; //当前page中有多少dot可用 unsigned short thisDrawDots;//实际填充dot到当前page中的个数 unsigned char startPage;//从哪page开始显示 if(0==Vlen || x >= GLCD_WIDTH || y >= GLCD_HEIGHT) return; drawVdots = GLCD_HEIGHT-y;//实际可显示这么高 if(Vlen <= drawVdots) drawVdots=Vlen; startPage=y/8; j=y%8;//如果是非整page段,y则是从第几个Bit开始填充 if(j) { leftdots = 8-j;//非整page段还有这么多个dot可显示 if(drawVdots > leftdots) thisDrawDots = leftdots; else thisDrawDots = drawVdots; for(k=0;k 8) thisDrawDots = 8; else thisDrawDots = drawVdots; for(k=0;k=6) flag=1; //guiShowBinMap(GLCD_WIDTH-15,48,"APN1.bin"); //guiShowBinMap(1,30,"APN2.bin"); return; //return; //char testbuf[5]={0xB2,0xE2,0xCA,0xD4,0x00}; //??ê?DD?? guiDrawHLine(1, GLCD_WIDTH-2, 1, 1, guiGetForeColor()); //??ê?áD?? guiDrawVLine(3, GLCD_HEIGHT-2, 1, 1, guiGetForeColor()); //??ê???D???D? guiDrawRect(3,3,3+10,3+10,1,guiGetForeColor()); //??ê?êμD???D? guiFillRect(15, 3, 15+10, 3+10,guiGetForeColor()); //??ê??yí· guiDrawArrow(50, 3,10, ARROW_UP, guiGetForeColor()); guiDrawArrow(70, 3+10,10, ARROW_DOWN, guiGetForeColor()); guiDrawArrow(90, 3+8,10, ARROW_LEFT, guiGetForeColor()); guiDrawArrow(110, 3+8,10, ARROW_RIGHT, guiGetForeColor()); //??ê?12X12×?·?′? guiShowStr(3, 30,"123测试45中,国AW", FONT_MODE_12X12, REVERSED_NO,guiGetForeColor(),guiGetBackColor()); //??ê?16X16×?·?′? guiShowStr(3, 50,"123测试45你。好AW", FONT_MODE_16X16, REVERSED_NO,guiGetForeColor(),guiGetBackColor()); //??ê?í??? guiShowBmp(3, 80, "Palace2.bmp"); //??ê?°′?ü guiShowButton(100, 80,"B12", FONT_MODE_12X12,guiGetForeColor(), guiGetBackColor()); }