//以下是放大4倍的字 程序
//
void ColourTo2(unsigned char bw,unsigned short WORD,unsigned short x,unsigned short y,unsigned long FrontColour,unsigned long BackgroundColour)
{
unsigned int j;
unsigned short xx,yy;
xx=x;yy=y;
for(j=0;j<bw;j++){
if(WORD&(0x01<<(bw-1))){PutPixel(xx,yy,FrontColour);PutPixel(xx+1,yy,FrontColour);PutPixel(xx,yy+1,FrontColour);PutPixel(xx+1,yy+1,FrontColour);}
else {PutPixel(xx,yy,BackgroundColour);PutPixel(xx+1,yy,BackgroundColour);PutPixel(xx,yy+1,BackgroundColour);PutPixel(xx+1,yy+1,BackgroundColour);}
WORD=WORD<<1;
xx=xx+2;
}
}
//
//
void WORD_writTo2(unsigned short WORD1,unsigned short x,unsigned short y,unsigned long FrontColour,unsigned long BackgroundColour)
{
unsigned char j;
unsigned short w,xx,yy;
xx=x;yy=y;
for(j=0;j<16;j++){
w=word_816[WORD1*16+j];
ColourTo2(8,w,xx,yy+j*2,FrontColour,BackgroundColour);
}//end for
}
//显示str的值,
//ok111111111111111111
void display_strTo2(char *str,unsigned short x,unsigned short y,unsigned long FrontColour,unsigned long BackgroundColour)
{
unsigned char i;
unsigned short xx,yy;
xx=x;yy=y;
for(i=0;str[i]!='\0';i++){
//判断是否要换行
if(xx+16>=HSIZE){
xx=0;
yy=yy+32;
////判断是否要换页
if(yy+32>=VSIZE)yy=0;
}
WORD_writTo2(str[i],xx,yy,FrontColour,BackgroundColour);
xx=xx+16;
}
} |