#include<dos.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<process.h>
#define VGA256 0x13
#define TEXT_MODE 0x03
unsigned char far *video_buffer=(char far *)0xA0000000L;
unsigned char bit[8]={128,64,32,16,8,4,2,1};
void Delay(int clicks)
{
unsigned int far *clock=(unsigned int far *)0x0000046CL;
unsigned int now;
now=*clock;
while(abs(*clock-now)<clicks){}
}
void Plot_Pixel_Fast(int x,int y,char color)
{
video_buffer[((y<<8)+(y<<6))+x]=color;
}
void GetHzBit(char ch0,char ch1,char *bitdata)
{
FILE *stream;
long fpos;
fpos=32L*(((unsigned char)ch0-161)*94+((unsigned char)ch1-161));
if((stream=fopen("hzk16","rb"))==NULL){
printf("Open hzk16 error!\\n");
exit(0);
}
fseek(stream, fpos, SEEK_SET);
fread( bitdata, 32, 1, stream);
fclose(stream);
}
void WriteHz(char ch0,char ch1,int x,int y,int color)
{
register int i,j,k;
unsigned vpos;
char bitdata[32];
GetHzBit(ch0,ch1,bitdata);
for(i=0;i<16;i++)
for(j=0;j<8;j++){
if(bitdata[2*i]&bit[j])
Plot_Pixel_Fast(x+j,i+y,color);
if(bitdata[2*i+1]&bit[j])
Plot_Pixel_Fast(x+8+j,i+y,color);
}
}
void WriteHzStr(char *str,int x,int y,int color)
{
int num,i,j,xx;
unsigned char s0,s1;
num=strlen(str);
xx=x;
for(i=0;i<num;i+=2){
WriteHz(str[i],str[i+1],xx,y,color);
xx+=16;
}
}
void Words_Step(char *str,int x,int y,int color,int speed)
{
int num,i,j,xx;
unsigned char s0,s1;
num=strlen(str);
xx=x;
for(i=0;i<num;i+=2){
WriteHz(str[i],str[i+1],xx,y,color);
Delay(speed);
xx+=16;
}
}
void Set_Video_Mode(int mode)
{
union REGS inregs,outregs;
inregs.h.ah=0;
inregs.h.al=(unsigned char)mode;
int86(0x10,&inregs,&outregs);
}
void main(void)
{
Set_Video_Mode(VGA256);
WriteHzStr("按任意键进入中文渐显:",10,100,WHITE);
getch();
Words_Step("现在文字处于渐显状态。",10,130,WHITE,4);
getch();
Set_Video_Mode(TEXT_MODE);
}
这是别人在这个论坛里贴出来的,它已经包括了你需要的东西。