本文不讨论显示驱动,只讨论怎样通过软件对图片进行取模然后让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, };