📄 shuchu_hanzi.c
字号:
#include<stdio.h>
#include<dos.h>
#include<fcntl.h>
#include<graphics.h>
#include<conio.h>
void puts16(int x,int y,char *s,unsigned char color)
{
register int i,j,k,m,n;
FILE *fpa,*fph;
char buffera[24],bufferh[32];
unsigned char qh,wh;
unsigned long location;
int Driver=DETECT,Mode;
initgraph(&Driver,&Mode,"E:\\tc");
directvideo=0;
cleardevice();
m=x;
if ((fph=fopen("f:\\hzk16","rb"))==NULL){
printf("can't open asc16!");
getch();
closegraph();
exit (0);
}
while(*s){
if(*s>0){
fseek(fpa,(*s)*16,0);
fread(buffera,16,1,fpa);
for(i=0;i<16;i++)
for(j=0;j<8;j++){
if(((buffera[i]>>(7-j))&0x1)!=NULL)
putpixel(j+x,i+y,color);
}
s++;
x=8+x+1;
}
else{
qh=*s-0xa0;
wh=*(s+1)-0xa0;
location=(94*(qh-1)+(wh-1))*32L;
fseek(fph,location,SEEK_SET);
fread(bufferh,32,1,fph);
for(i=0;i<16;i++)
for(j=0;j<2;j++)
for(k=0;k<8;k++)
if(((bufferh[i*2+j]>>(7-k))&0x1)!=NULL)
putpixel(x+8*j+k,y+i,color);
s+=2;
x=16+x+1;
}
}
fclose(fpa);
fclose(fph);
setcolor(color);
rectangle(m-2,y-1,x,y+17);
}
void main(void)
{
puts16(2,5,"文件WOZUI 法规",3);
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -