TC 中的汉字技术
2008-03-08 12:40:25 来源:WEB开发网核心提示:/*本程序由sunny整理完成---*/*** 基于DOS平台,在Turbo c2.0中调试通过 * 原码见于http://sunny1979.icpcn.com http://tchome.icpcn.com ***/#include "conio.h"#include "stdio
/*--------本程序由sunny整理完成-----------*/
*** 基于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;i<16;i++)
for(n=0;n<ROW;n++)
for(j=0;j<2;j++)
for(k=0;k<8;k++)
for(m=0;m<COL;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);
}
点这里下载
*** 基于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;i<16;i++)
for(n=0;n<ROW;n++)
for(j=0;j<2;j++)
for(k=0;k<8;k++)
for(m=0;m<COL;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);
}
点这里下载
更多精彩
赞助商链接