横完美自汉字显示1.c
来自「这是一个汉字点阵显示的示例」· C语言 代码 · 共 72 行
C
72 行
#include<stdio.h>
#include<conio.h>
void hanzik16(unsigned char*s)
{
int num=0;
int row,c;
unsigned char cmp_w[8]={128,64,32,16,8,4,2,1};
unsigned char qh, wh;
long location;
unsigned char buf[32];
FILE*fp;
if((fp=fopen("HZK16","rb"))==NULL)
{
printf("can not open HZK16!");
getch();
exit(1);
}
for(row=0;row<16;row++)
{
num=0;
while(*s)
{
++num;
qh=*s-0xa0;
wh=*(s+1)-0xa0;
location=(long)(94*(qh-1)+(wh-1))*32;
fseek(fp,location,SEEK_SET);
fread(buf,32,1,fp);
for(c=0;c<8;c++)
{
if((buf[row*2]&cmp_w[c])!=0)
printf("*");
else
printf(" ");
}
for(c=0;c<8;c++)
{
if((buf[row*2+1]&cmp_w[c])!=0)
printf("*");
else
printf(" ");
}
s+=2;
}
printf("\n");
s-=num*2;
}
fclose(fp);
}
void main()
{
unsigned char*s1="个人汉字显示";
hanzik16(s1);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?