TC 中的汉字技术
岁数大了,QQ也不闪了,微信也不响了,电话也不来了,但是图老师依旧坚持为大家推荐最精彩的内容,下面为大家精心准备的TC 中的汉字技术,希望大家看完后能赶快学习起来。
*** 基于DOS平台,在Turbo c2.0中调试通过 **
*** 原码见于http://sunny1979.icpcn.com http://tchome.icpcn.com ***/#include "conio.h"
#include "stdio.h"
#include "graphics.h"
#include "stdlib.h"
#include "dos.h"void *buffer;
FILE *fp;void hz(int x,int y,int a,int COL,int b,char *s)
{
int ROW;
char buffer[32];
register m,n,i,j,k;
unsigned char qh,wh;
unsigned long offset;
ROW=COL;
while(*s)
{
qh=*(s)-0xa0;
wh=*(s+1)-0xa0;
offset=(94*(qh-1)+(wh-1))*32L;
fseek(fp,offset,SEEK_SET);
fread(buffer,32,1,fp);
for (i=0;i16;i++)
for(n=0;nROW;n++)
for(j=0;j2;j++)
for(k=0;k8;k++)
for(m=0;mCOL;m++)
if (((buffer[i*2+j](7-k))&0x1)!=NULL)
putpixel(x+8*j*COL+k*COL+m,y+i*ROW+n,b);
s+=2;
x+=a;
}
}main()
{
int GD=DETECT,GM;
initgraph(&GD,&GM,"");
if ((fp=fopen("hzk16","rb"))==NULL)
{ printf("Can't open haz16,Please add it");
getch(); closegraph(); exit(0);
}
hz(342,245,25,1,4,"确定");
getch();
closegraph();
close(fp);
clrscr();
exit(0);
}
点这里下载