当前位置: 代码迷 >> C语言 >> [求助] ■ 关于输出汉字的问题 ■
  详细解决方案

[求助] ■ 关于输出汉字的问题 ■

热度:257   发布时间:2007-08-06 17:36:56.0
[求助] ■ 关于输出汉字的问题 ■

平时写东西是总想写的东西输出汉字,今天用turboc for windows的时候看到了汉字取模表,看了说明,传说这个东西可以让C输出中文(图形模式).

如说明:

本程序必须在图形模式下使用,请使用以下的函数输出汉字。
void drawmat(char *mat,int matsize,int x,int y,int color)
/*依次:字模指针、点阵大小、起始坐标(x,y)、颜色*/
{int i,j,k,n;
n=(matsize-1)/8+1;
for(j=0;j<matsize;j++)
for(i=0;i<n;i++)
for(k=0;k<8;k++)
if(mat[j*n+i]&(0x80>>k)) /*测试为1的位则显示*/
putpixel(x+i*8+k,y+j,color);
}

在比如汉字"帅":

16*16:

char shuai[]={
0x08,0x20,0x08,0x20,0x08,0x20,0x4B,0xFE,
0x4A,0x22,0x4A,0x22,0x4A,0x22,0x4A,0x22,
0x4A,0x22,0x4A,0x22,0x4A,0x22,0x12,0x2E,
0x12,0x24,0x20,0x20,0x40,0x20,0x80,0x20,
};

32*32


char shuai[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0x0C,0x00,0x00,0x70,0x0E,0x00,
0x00,0x70,0x0C,0x00,0x00,0x70,0x0C,0x00,
0x08,0x70,0x0C,0x00,0x0E,0x70,0x0C,0x00,
0x0E,0x73,0x0C,0x38,0x0C,0x73,0xFF,0xF8,
0x0C,0x73,0x0C,0x30,0x0C,0x73,0x0C,0x30,
0x0C,0x73,0x0C,0x30,0x0C,0x73,0x0C,0x30,
0x0C,0x73,0x0C,0x30,0x0C,0x63,0x0C,0x30,
0x0C,0x63,0x0C,0x30,0x0C,0x63,0x0C,0x30,
0x0C,0x63,0x0C,0x30,0x0C,0x63,0x0C,0x30,
0x0C,0xE3,0x0C,0x30,0x0C,0xE3,0x0C,0x38,
0x0C,0xC3,0x0D,0xF0,0x08,0xC3,0x0D,0xF0,
0x01,0xC3,0x0C,0x60,0x03,0x83,0x0C,0x40,
0x03,0x00,0x0C,0x00,0x06,0x00,0x0C,0x00,
0x0C,0x00,0x0C,0x00,0x18,0x00,0x0C,0x00,
0x30,0x00,0x0C,0x00,0x00,0x00,0x08,0x00,
};

=================================================================

但是我一直不知道怎么用,哪个仁兄做一个示范啊?

要求输出: 帅 帅 帅

=================================================================

搜索更多相关的解决方案: 汉字  输出  

----------------解决方案--------------------------------------------------------
  相关解决方案