大学生
最后登录1970-1-1
在线时间 小时
注册时间2014-3-14
|
发表于 2016-7-21 21:09:52
|
显示全部楼层
代码内带字库
***************************************************************/
#if FONT_HZ_TYPE==FONT_HZ_TYPE_CODE
const HZ_CODE16 Hz_Code16[]=
{ "接",
0x08,0x01,0x08,0x02,0xC8,0x3F,0x08,0x00,0xBF,0x10,0x08,0x09,0xE8,0x7F,0x08,0x02,
0x18,0x02,0xEC,0x7F,0x0B,0x11,0x88,0x10,0x08,0x09,0x08,0x06,0x8A,0x19,0x64,0x20,/*"接",0*/
"收",
0x10,0x02,0x10,0x02,0x12,0x02,0x12,0x01,0x12,0x7F,0x92,0x10,0x52,0x11,0x12,0x11,
0x12,0x11,0x1A,0x0A,0x16,0x0A,0x12,0x04,0x10,0x0A,0x10,0x11,0x90,0x20,0x50,0x40,/*"收",1*/
"到",
0x00,0x20,0xFF,0x21,0x10,0x20,0x08,0x24,0x44,0x24,0x82,0x24,0xFF,0x25,0x10,0x25,
0x10,0x24,0x10,0x24,0xFE,0x24,0x10,0x24,0x10,0x20,0xF0,0x21,0x1F,0x28,0x02,0x10,/*"到",2*/
"的",
0x08,0x02,0x08,0x02,0x04,0x02,0x7E,0x3E,0x42,0x21,0x42,0x21,0xC2,0x20,0x42,0x22,
0x7E,0x24,0x42,0x24,0x42,0x20,0x42,0x20,0x42,0x20,0x7E,0x20,0x42,0x14,0x00,0x08,/*"的",3*/
"遥",
0x00,0x3C,0xC4,0x03,0x08,0x20,0x48,0x22,0x80,0x14,0x80,0x3F,0x4F,0x04,0x08,0x04,
0xC8,0x7F,0x08,0x04,0x88,0x24,0x88,0x24,0x88,0x24,0x88,0x3F,0x14,0x00,0xE2,0x7F,/*"遥",4*/
void TFTShowStrGBK(LOC_X x,LOC_Y y,u8 nHz,u8 *pStr,COLOR color,COLOR bkColor)
{
u8 i=0,j=0,k=0;
u16 temp;
u16 *pCode;
while(nHz--)
{
i=0;
while(0xff!=Hz_Code16[i].Hz_Index[0]) //
{
if(*pStr==Hz_Code16[i].Hz_Index[0]
&&*(pStr+1)==Hz_Code16[i].Hz_Index[1]) //
{
pCode= (u16*)(&Hz_Code16[i].Code[0]);
for(j=0;j<16;j++) //16行
{
TFTSetXY(x,y);
temp=*pCode++;
for(k=16;k>0;k--) //一行 16bit
{
if(temp & 0x01)
{
_TFTPoint(color); //写有效点
}
else
{
if (bkColor)
_TFTPoint(bkColor);//写底色
else
TFTSetXY(x+k+1,y); //偏移一个点
}
temp>>=1;
}
y++;//换行
}
x+=16; y-=16;
break;
} // end of if(*pStr==Hz_Code[i].Hz_Index[0]...
i++;
}
pStr+=2;
}
}
要显示的地方调用
TFTShowStrGBK(5,50,14,"接收到的遥控信息:你好中国人",RED,WHITE); |
|