ST7920 12864液晶图片取模,显示你想显示的图片。

本文不讨论显示驱动,只讨论怎样通过软件对图片进行取模然后让12864显示。

1、将需要显示的图片进行处理

首先12864只能显示黑白图像而且不能显示灰度,因此可以确定图片的要求:

图像大小:128像素*64像素

图像格式:bmp

图像位数:1

处理方法如下:

先将要显示的图像进行裁剪,按照2:1的比例

更改图像大小为128像素*64像素

保存图像为bmp格式颜色深度为1或者就是黑白模式

以上操作可以使用Photoshop来完成,通过以上操作可以得到要显示的图片。

2、导入图像进行取模

到网上找一个PCtoLCD2002的软件,点击打开导入刚刚生成的图像

点击选项按照图进行设置

上面的设置是我试验得到的,阴码和阳码显示的颜色是相反的,取模走向的区别是显示的是镜像关系,根据程序中的格式选择相应的前后缀生成字模即可。

如河海大学的书法字模:const unsigned char hohai[] = { 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,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,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,0x02,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0x00, 0x00,0x00,0x00,0x1C,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xCF,0x00, 0x01,0xE0,0x00,0x3C,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0xCF,0x00, 0x01,0xE0,0x00,0x7C,0x00,0x00,0x06,0x00,0x00,0x00,0x60,0x00,0x00,0x1F,0xCE,0x00, 0x01,0xE0,0x00,0xF8,0x00,0x00,0x06,0x00,0x00,0x00,0x70,0x00,0x00,0x1F,0xDC,0x00, 0x01,0xE0,0x01,0xF0,0x00,0x00,0x04,0x00,0x00,0x00,0x70,0x00,0x00,0x0F,0x9C,0x00, 0x01,0xC0,0x03,0xE0,0x00,0x00,0x0C,0x00,0x00,0x00,0x70,0x00,0x00,0x0F,0x9C,0x00, 0x00,0x00,0x07,0xC0,0x00,0x00,0x08,0x00,0x00,0x00,0x70,0x00,0x00,0x0F,0xFC,0x00, 0x00,0x00,0x0F,0x80,0x00,0xE0,0x08,0x00,0x00,0x00,0x70,0x00,0x00,0x0F,0xFE,0x00, 0x00,0x00,0x1F,0x80,0x00,0xF0,0x18,0x00,0x00,0x00,0x60,0x00,0x00,0x0F,0xEE,0x00, 0x00,0x00,0x3B,0xC0,0x00,0xF0,0x10,0xE0,0x00,0x00,0x60,0x00,0x00,0x0F,0xE6,0x00, 0x00,0x00,0x73,0xE0,0x00,0xF0,0x11,0xE0,0x00,0x00,0x60,0x00,0x00,0x0F,0xEE,0x00, 0x00,0x00,0x66,0xE0,0x00,0x70,0x27,0xC0,0x00,0x00,0x60,0x00,0x00,0x0F,0xCC,0x00, 0x00,0x00,0xE4,0x40,0x00,0x70,0x3C,0x80,0x00,0x00,0x60,0x00,0x00,0x0E,0xF8,0x00, 0x01,0x81,0xC4,0x40,0x00,0x00,0x38,0x80,0x00,0x00,0x60,0x00,0x00,0x0E,0xF3,0xC0, 0x03,0xC1,0x8C,0x40,0x00,0x00,0x31,0x00,0x00,0x00,0x64,0x00,0x00,0x0E,0xFF,0xC0, 0x03,0xC3,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x0C,0xFF,0xC0, 0x03,0xC7,0x0A,0x40,0x00,0x20,0x02,0x60,0x00,0x00,0xFF,0x00,0x00,0x0C,0xF8,0xC0, 0x01,0xC6,0x1E,0xC0,0x00,0x70,0x00,0xE0,0x00,0x00,0xFF,0x00,0x00,0x01,0xF0,0xC0, 0x01,0xCC,0x1E,0xC0,0x00,0x70,0x04,0x60,0x00,0x1B,0xFE,0x00,0x00,0x03,0xE1,0x80, 0x01,0x8C,0x3E,0xC0,0x00,0x70,0x04,0x60,0x00,0x3F,0xE0,0x00,0x00,0x0F,0x83,0x00, 0x01,0x9C,0x3E,0x40,0x00,0x30,0x04,0x60,0x00,0x3F,0xC0,0x00,0x00,0x1F,0x00,0x00, 0x03,0x18,0x3E,0xC0,0x00,0x20,0x09,0xE0,0x00,0x3F,0xC0,0x00,0x00,0x3C,0x38,0x00, 0x03,0x18,0x6E,0xC0,0x00,0x60,0x0B,0xE0,0x00,0x1C,0xC0,0x00,0x06,0x70,0x38,0x00, 0x03,0x30,0x66,0xC0,0x00,0x40,0x0B,0xFE,0x00,0x00,0xC0,0x00,0x07,0xE0,0xF0,0x00, 0x03,0x30,0x60,0xC0,0x00,0x40,0x1B,0xFF,0x00,0x01,0xC0,0x00,0x07,0xC0,0xF0,0x00, 0x03,0x20,0x60,0xC0,0x00,0x00,0xFF,0xE2,0x00,0x01,0xC0,0x00,0x0F,0x80,0x20,0x00, 0x03,0x60,0x00,0xC0,0x00,0x88,0xFF,0xC0,0x00,0x01,0x80,0x00,0x06,0x00,0x20,0x00, 0x03,0x60,0x00,0xC0,0x00,0x88,0x7E,0xC0,0x00,0x01,0x84,0x00,0x00,0x00,0x20,0x00, 0x03,0x40,0x00,0xC0,0x00,0x90,0x30,0xC0,0x00,0x03,0x06,0x00,0x00,0x00,0x30,0x00, 0x02,0x40,0x00,0xC0,0x00,0x90,0x19,0xC0,0x00,0x03,0x07,0x00,0x00,0x00,0x10,0x00, 0x02,0x40,0x00,0xC0,0x00,0xB0,0x3F,0xE0,0x00,0x06,0x07,0x80,0x00,0x00,0x18,0x00, 0x03,0xC0,0x00,0xC0,0x00,0xB0,0x1F,0xE0,0x00,0x06,0x03,0xC0,0x00,0x00,0x08,0x00, 0x03,0xC0,0x00,0xC0,0x01,0xF0,0x1F,0xC0,0x00,0x0E,0x01,0xC0,0x00,0x00,0x1F,0x80, 0x03,0xC0,0x00,0xC0,0x01,0xF0,0x00,0xC0,0x00,0x1C,0x01,0xE0,0x00,0x00,0x7F,0x80, 0x03,0xC0,0x00,0xC0,0x01,0xE0,0x01,0x80,0x00,0x78,0x01,0xE0,0x00,0x00,0xFF,0x80, 0x03,0xC0,0x00,0xC0,0x01,0xE0,0x01,0x80,0x00,0x70,0x00,0xE0,0x00,0x01,0xFF,0x00, 0x03,0x80,0x00,0xC0,0x01,0xE0,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x01,0x84,0x00, 0x03,0x80,0x00,0xC0,0x01,0xC0,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0x8C,0x00, 0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x00, 0x00,0x00,0x01,0xC0,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x00, 0x00,0x00,0x01,0xC0,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x00, 0x00,0x00,0x01,0xC0,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x18,0x00, 0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, };

。打开功能是专门用于对C语言文件自动提取显示所需要的汉字,进行点阵码数据转换的, 在您的C语言程序中,有一点需要特别留意:您的注解中请不要使用双引号,否则会引起 提取错误。 软件包中的文件ee.c作为一个简单例程供提取测试用。 2。提取以后的点阵码可以随意修改点阵数据,使用鼠标的左键为加一点,右键为擦除一点。 修改完毕请按旁边的确认键将数据记录到点阵码中,否则您的修改将自动放弃。 3。点阵码可以随意平移,请谨慎使用。平移之前请查看一遍所有的字符点阵图,平移有可能 会丢失边界点,移出了边界的点阵将被丢弃,不可恢复。 平移前请确认是否有必要进行全体字符一起移动。 4。用户自定义特殊字符的建立,首先选定点阵数据,在下面的汉字输入窗口输入几个您不使 用的汉字,确认。然后生成了这些汉字的点阵码,再将他们清空(使用平移按钮中间的那 块抹布),就可以用鼠标描绘你的图案了,最后别忘了打“确认”键。 5。ASCII字符可以自动提取0x20~0x7f的全部,最后一个0x7f一般都没有用,可以手工将它删 除,也可以利用它做一个简单的特殊字符。 汉字库中也包含有ascii字符,但是经查对与这三个ascii库基本一样,所以就不再重复。 6。保存文件:C语言格式的默认为.h类型,汇编格式的默认为.inc类型,只要将他们加入到 您的工程中就可以了。 7。新增加了自动添加下划线功能。这项功能在做点阵显示和修改的时候并不出现下划线, 设置了以后仅仅在最后的输出文件中出现,以免干扰编辑修改。 8。扩充对windows汉字的直接提取,从16~96范围内可以任意设定选取。主要用于制作界面的 开机封面少量标识性汉字。 9。扩充了对ascii小字库5x8以及大字库20*40/24*48的支持,毕竟字库文件比较工整。 -----------------2004.12.10更新内容 10。增加了字模输出格式的选择,可以将汉字码与点阵数据分开列表; 11。增加了对单色.bmp文件的支持,可以从原有的bitmap文件上截取一部分作为点阵码数据 输出,点阵图案可以随意修改。 12。bitmap用户自建方案,可以先设定好图形的宽度和高度,然后用打开图形文件窗口下选 择取消,自动生成一块空白的图板。 13。图形区域显示的图形点阵可以用调节拉条进行放大或缩小。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值