/*--------本程序由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);
}
點這裡下載