初级会员

- 积分
- 157
- 金钱
- 157
- 注册时间
- 2020-12-19
- 在线时间
- 20 小时
|
5金钱
void LCD_ShowString(u16 x,u16 y,u16 width,u16 height,u8 size,u8 *p)
{
u8 x0=x;
width+=x;
height+=y;
while((*p<='~')&&(*p>=' '))
{
if(x>=width){x=x0;y+=size;}
if(y>=height)break;
LCD_ShowChar(x,y,*p,size,0);
x+=size/2;
p++;
}
}
void LCD_ShowChar(u16 x,u16 y,u8 num,u8 size,u8 mode)
{
u8 temp,t1,t;
u16 y0=y;
u8 csize=(size/8+((size%8)?1:0))*(size/2); //μÃμ½×Öìåò»¸ö×Ö·û¶Ôó|μãÕó¼ˉËùÕ¼μÄ×Ö½úêy
num=num-' ';//μÃμ½Æ«òÆoóμÄÖ죨ASCII×Ö¿aêÇ′ó¿Õ¸ñ¿aê¼è¡Ä££¬ËùòÔ-' '¾íêǶÔó|×Ö·ûμÄ×Ö¿a£©
for(t=0;t<csize;t++)
{
if(size==12)temp=asc2_1206[num][t]; //μ÷óÃ1206×Öìå
else if(size==16)temp=asc2_1608[num][t]; //μ÷óÃ1608×Öìå
else if(size==24)temp=asc2_2412[num][t]; //μ÷óÃ2412×Öìå
else return; //ûóDμÄ×Ö¿a
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_Fast_DrawPoint(x,y,POINT_COLOR);
else if(mode==0)LCD_Fast_DrawPoint(x,y,BACK_COLOR);
temp<<=1;
y++;
if(y>=lcddev.height)return; //3¬ÇøóòáË
if((y-y0)==size)
{
y=y0;
x++;
if(x>=lcddev.width)return; //3¬ÇøóòáË
break;
}
}
}
}
这两段程序怎么理解啊,我新手一点看不懂
|
|