|
/*******************************************************
* Name : 寫漢字函數(shù)32*32
* Parameter : x :x坐標(biāo)
y :y坐標(biāo)
*p :漢字串
wordColor:字體顏色
backColor:背景顏色
* Return : void
* Function : 寫漢字*******************************************************/
void LCD_ShowChinese(uint16_t x, uint16_t y, uint8_t *p, uint16_t wordColor, uint16_t backColor)
{
uint16_t tPOINT_COLOR = POINT_COLOR,tBACK_COLOR=BACK_COLOR ;//記錄原先的前景色、后景色
uint8_t wordByte ;
uint16_t wordNum;
uint8_t color;
u8 k=0;
while(*p != '\0')
{
for(wordNum=0;wordNum<CH_MAX_INDEX_32;wordNum++)
{
if(*p==GB_32[wordNum].Index[0] && *(p+1)==GB_32[wordNum].Index[1])
{
for(wordByte = 0;wordByte < 128; wordByte++)
{
color = GB_32[wordNum].Msk[wordByte];
for ( k = 0;k<8; k++)
{
if ((color&0x80) == 0x80)
{
POINT_COLOR = wordColor;
LCD_DrawPoint(x+wordByte/4,y+k+((wordByte)%4)*8);
}
else
{
POINT_COLOR = backColor;
LCD_DrawPoint(x+wordByte/4,y+k+((wordByte)%4)*8);
}
color = color<<1;
}
}
p+=2;
x+=32;
if(x>lcddev.width)
{
x=0;
y+=32;
}
}
}
}
POINT_COLOR = tPOINT_COLOR;
BACK_COLOR = tBACK_COLOR;
}
|
-
-
LCD.zip
2019-5-26 17:32 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
91.32 KB, 下載次數(shù): 48, 下載積分: 黑幣 -5
|