分享
 
 
 

点阵字模工具编程辅助效果示例

王朝other·作者佚名  2008-06-01
窄屏简体版  字體: |||超大  

/*************** 点阵字模工具编程辅助效果示例 ***************/

/************************************************************************

该示例中的字模数组均由“点阵字模工具”生成,你可以用你自己需要的点阵信息来

替换示例中的字模信息,注重字模大小要一致,否则显示会出问题。

用WIN-TC的字模工具生成指定字模信息能给你提供方便的集成小型字库解决方案

************************************************************************/

#include "Conio.h"

#include "graphics.h"

#define closegr closegraph

void initgr(void) /* BGI初始化 */

{int gd=DETECT,gm=0; /* 和gd=VGA,gm=VGAHI是同样效果 */

registerbgidriver(EGAVGA_driver);/* 注册BGI驱动后可以不需要.BGI文件的支持运行 */

initgraph(&gd,&gm,"");

}

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);

}

char shan16[]={

/* 以下是 '山' 的 16点阵宋体 字模,32 byte */

0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,

0x01,0x00,0x01,0x00,0x01,0x08,0x21,0x08,

0x21,0x08,0x21,0x08,0x21,0xF8,0x2E,0x08,

0x30,0x08,0x00,0x00,0x00,0x00,0x00,0x00,

};

char dong16[]={

/* 以下是 'dong' 的 16点阵宋体 字模,32 byte */

0x01,0x00,0x01,0x00,0x02,0x00,0x03,0xF0,

0x3C,0x00,0x05,0x00,0x09,0x00,0x11,0xF0,

0x1F,0x00,0x01,0x00,0x09,0x20,0x09,0x10,

0x11,0x08,0x23,0x00,0x01,0x00,0x00,0x00,

};

char da16[]={

/* 以下是 '点' 的 16点阵宋体 字模,32 byte */

0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,

0x02,0x00,0x03,0xF0,0x3E,0x00,0x02,0x00,

0x05,0x00,0x04,0x80,0x08,0x40,0x10,0x20,

0x20,0x18,0x40,0x0E,0x00,0x00,0x00,0x00,

};

char xue16[]={

/* 以下是 '阵' 的 16点阵宋体 字模,32byte */

0x00,0x20,0x12,0x20,0x09,0x20,0x00,0x40,

0x23,0xFC,0x3C,0x08,0x63,0xC0,0x44,0x80,

0x01,0x00,0x01,0xF8,0x7E,0x80,0x00,0x80,

0x00,0x80,0x02,0x80,0x01,0x00,0x00,0x00,

};

char wei16[]={

/* 以下是 '宋' 的 16点阵宋体 字模,32 byte */

0x01,0x00,0x01,0x20,0x01,0x10,0x01,0xE0,

0x3F,0x00,0x21,0x00,0x22,0x90,0x2C,0x90,

0x27,0x50,0x3D,0x60,0x2A,0x20,0x44,0x52,

0x4A,0x8A,0x91,0x06,0x00,0x00,0x00,0x00,

};

char hai16[]={

/* 以下是 '体' 的 16点阵宋体 字模,32 byte */

0x01,0x00,0x01,0x00,0x21,0x70,0x13,0x80,

0x04,0x30,0x43,0xD0,0x22,0x90,0x02,0xFE,

0x1F,0x90,0x22,0x90,0x24,0x10,0x47,0xFC,

0x40,0x20,0x00,0xA0,0x00,0x40,0x00,0x00,

};

char fen16[]={

/* 以下是 '字' 的 16点阵隶书 字模,32 byte */

0x00,0x00,0x03,0x00,0x00,0x80,0x04,0x40,

0x04,0x20,0x08,0x18,0x10,0x0E,0x21,0xC0,

0xDE,0x40,0x02,0x40,0x04,0x40,0x08,0x40,

0x12,0x80,0x61,0x00,0x00,0x00,0x00,0x00,

};

char xiao16[]={

/* 以下是 '模' 的 24点阵楷体_GB2312 字模,72 byte */

0x00,0x00,0x10,0xC0,0x10,0x20,0x10,0x78,

0x13,0x80,0x1C,0x30,0x71,0x08,0x12,0x20,

0x39,0x20,0x54,0xA0,0x90,0x40,0x10,0xA0,

0x11,0x18,0x16,0x0E,0x10,0x00,0x00,0x00,

};

char dian32[]={

/* 以下是 '灌' 的 32点阵黑体 字模,128 byte */

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,

0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,

0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,

0x07,0xFF,0xFF,0x80,0x06,0x03,0x00,0x80,

0x06,0x03,0x00,0x80,0x06,0x03,0x00,0x80,

0x06,0x03,0x00,0x80,0x06,0x03,0x00,0x80,

0x07,0xFF,0xFF,0x80,0x07,0xFF,0xFF,0x80,

0x06,0x03,0x00,0x80,0x06,0x03,0x00,0x80,

0x06,0x03,0x00,0x80,0x06,0x03,0x00,0x80,

0x06,0x03,0x00,0x80,0x07,0xFF,0xFF,0x80,

0x06,0x03,0x00,0x00,0x06,0x03,0x00,0x00,

0x06,0x03,0x00,0x00,0x06,0x03,0x00,0x00,

0x00,0x03,0x00,0x18,0x00,0x01,0x00,0x18,

0x00,0x01,0xFF,0xF0,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char zi32[]={

/* 以下是 '灌' 的 32点阵方正黄草简体 字模,128 byte */

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x03,0xFF,0xFF,0xC0,0x03,0xFF,0xFF,0xC0,

0x00,0x00,0x03,0x80,0x00,0x00,0x06,0x00,

0x00,0x00,0x18,0x00,0x00,0x00,0x70,0x00,

0x00,0x01,0xC0,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x3F,0xFF,0xFF,0xFC,

0x3F,0xFF,0xFF,0xFC,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x01,0x80,0x00,0x00,0x01,0x80,0x00,

0x00,0x1F,0x80,0x00,0x00,0x0F,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char xi32[]={

/* 以下是 'xi' 的 32点阵楷体_GB2312 字模,128 byte */

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,

0x00,0x00,0x7F,0xE0,0x07,0xFF,0xC0,0x00,

0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,

0x00,0x04,0x00,0x00,0x00,0x08,0x06,0x00,

0x00,0x10,0x0E,0x00,0x00,0x60,0x18,0x00,

0x01,0xFF,0xE0,0x00,0x00,0x81,0x80,0x00,

0x00,0x03,0x00,0x00,0x00,0x04,0x03,0x00,

0x00,0x18,0x00,0x80,0x00,0x60,0x00,0xE0,

0x03,0xFF,0xFF,0xF0,0x03,0xE0,0xC0,0x38,

0x00,0x00,0xC0,0x10,0x00,0x00,0xC0,0x00,

0x00,0x00,0xC0,0x00,0x00,0xC0,0xC3,0x00,

0x01,0x80,0xC1,0xC0,0x03,0x00,0xC0,0x60,

0x06,0x00,0xC0,0x30,0x0C,0x00,0xC0,0x10,

0x00,0x0F,0x80,0x00,0x00,0x07,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char yao32[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x40,0x42,0x00,

0x00,0x60,0x46,0x00,0x00,0xC0,0x66,0x00,

0x00,0x80,0x64,0x00,0x01,0x06,0x64,0x60,

0x03,0x03,0x64,0xC0,0x33,0x30,0x64,0x00,

0x7F,0xF0,0x64,0x00,0x06,0x20,0x64,0x00,

0x06,0x23,0x45,0x80,0x02,0x46,0x44,0x40,

0x01,0xC0,0x44,0x00,0x01,0xC0,0x46,0x00,

0x03,0x30,0xC6,0x00,0x06,0x01,0x83,0x82,

0x3C,0x07,0x03,0xFC,0x10,0x1E,0x01,0xFC,

0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char peng32[]=;

main()

{int i,j;

initgr(); /* BGI初始化 */

drawmat(shan16,16,220,125,RED);

drawmat(dong16,16,250,125,RED);

drawmat(da16,16,280,125,GREEN);

drawmat(xue16,16,310,125,GREEN);

drawmat(wei16,16,340,125,YELLOW);

drawmat(hai16,16,370,125,YELLOW);

drawmat(fen16,16,400,125,GREEN);

drawmat(xiao16,16,430,125,GREEN);

drawmat(dian32,32,300,140,RED);

drawmat(zi32,32,340,140,YELLOW);

drawmat(xi32,32,380,140,GREEN);

drawmat(yao32,32,310,180,GREEN);

drawmat(peng32,32,350,180,GREEN);

getch(); /* 暂停一下,看看前面绘图代码的运行结果 */

closegr(); /* 恢复TEXT屏幕模式 */

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有