您的位置:首页 > 其它

20121106作业,qvfb使用——>打汉字,打印bmp图片

2013-09-18 21:13 260 查看
////////hzfont.h///////////////
#ifndef __HZFONT_H
#define __HZFONT_H
typedef unsigned char uint8_t;
typedef unsigned long uint32_t;
extern uint8_t flash_array1[][32];
extern uint8_t flash_array2[][16];
#endif

//////////hzfont.c/////////////

//Flash????×???????
#include "hzfont.h"
uint8_t flash_array1[][32]={
//??00
0x00,0x80,0x00,0xA0,0x00,0x90,0x3F,0xFC,
0x20,0x80,0x20,0x80,0x20,0x84,0x3E,0x44,
0x22,0x48,0x22,0x48,0x22,0x30,0x2A,0x20,
0x24,0x62,0x40,0x92,0x81,0x0A,0x00,0x06,

//??01
0x10,0x00,0x12,0x7C,0x7F,0x44,0x12,0x44,
0x14,0x48,0xFF,0x48,0x08,0x50,0x12,0x48,
0x3F,0x44,0x62,0x42,0xA2,0x42,0x3E,0x62,
0x22,0x54,0x22,0x48,0x3E,0x40,0x22,0x40,

//??02
0x08,0x04,0x05,0x7E,0x3F,0xC4,0x21,0x44,
0x21,0x44,0x3F,0x7C,0x21,0x44,0x21,0x44,
0x3F,0x44,0x21,0x7C,0x20,0x44,0x24,0x44,
0x26,0x44,0x79,0x84,0x21,0x14,0x02,0x08,

//??03
0x02,0x00,0x01,0x00,0x7F,0xFE,0x40,0x02,
0x80,0x24,0x1F,0xF0,0x01,0x00,0x01,0x08,
0x7F,0xFC,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00,

//?·04
0x10,0x00,0xF8,0x04,0x27,0xFE,0x20,0x20,
0x20,0x20,0x20,0x40,0xF8,0x40,0x20,0xD0,
0x21,0x4C,0x22,0x46,0x24,0x42,0x20,0x40,
0x38,0x40,0xE0,0x40,0x40,0x40,0x00,0x40,

//±?05
0x08,0x08,0x0B,0xFC,0x0A,0x08,0x12,0x08,
0x12,0x08,0x33,0xF8,0x32,0x40,0x50,0x44,
0x9F,0xFE,0x10,0x40,0x10,0xE0,0x11,0x50,
0x12,0x48,0x14,0x4E,0x18,0x44,0x10,0x40,

//??06
0x04,0x10,0x0E,0x10,0xF8,0x90,0x08,0x50,
0x08,0x10,0xFE,0x90,0x08,0x50,0x1C,0x14,
0x1A,0x1E,0x29,0xF0,0x28,0x10,0x48,0x10,
0x88,0x10,0x08,0x10,0x08,0x10,0x08,0x10,

//??07
0x10,0x40,0x10,0x40,0x10,0x48,0x13,0xFC,
0xFC,0x40,0x10,0x40,0x10,0x40,0x13,0xF8,
0x1A,0x08,0x31,0x10,0xD1,0x10,0x10,0xA0,
0x10,0x40,0x10,0xB0,0x51,0x0E,0x26,0x04,

//??08
0x02,0x00,0x02,0x04,0xFF,0xFE,0x04,0x00,
0x04,0x10,0x0F,0xF8,0x08,0x10,0x18,0x10,
0x2F,0xF0,0x48,0x10,0x88,0x10,0x0F,0xF0,
0x08,0x10,0x08,0x10,0x08,0x50,0x08,0x20,

//??09
0x00,0x08,0x7D,0xFC,0x45,0x08,0x49,0x08,
0x49,0xF8,0x51,0x08,0x49,0x08,0x49,0xF8,
0x45,0x04,0x45,0x88,0x45,0x50,0x69,0x20,
0x51,0x10,0x41,0x4E,0x41,0x84,0x41,0x00,

//??10
0x00,0x00,0x00,0x80,0x04,0x80,0x04,0x40,
0x08,0x40,0x08,0x20,0x11,0x10,0x21,0x0E,
0xC2,0x04,0x02,0x00,0x04,0x00,0x08,0x40,
0x10,0x20,0x1F,0xF0,0x00,0x10,0x00,0x00,

//??11
0x00,0x08,0x3F,0xFC,0x00,0x08,0x00,0x48,
0xFF,0xE8,0x00,0x08,0x00,0x88,0x3F,0xC8,
0x20,0x88,0x20,0x88,0x20,0x88,0x20,0x88,
0x3F,0x88,0x20,0x88,0x00,0x28,0x00,0x10,

//??12
0x00,0x80,0x00,0x80,0xFC,0x80,0x04,0xFC,
0x45,0x04,0x46,0x48,0x28,0x40,0x28,0x40,
0x10,0x40,0x28,0x40,0x24,0xA0,0x44,0xA0,
0x81,0x10,0x01,0x08,0x02,0x0E,0x0C,0x04,

//??13
0x00,0x00,0x41,0x84,0x26,0x7E,0x14,0x44,
0x04,0x44,0x04,0x44,0xF4,0x44,0x14,0xC4,
0x15,0x44,0x16,0x54,0x14,0x48,0x10,0x40,
0x10,0x40,0x28,0x46,0x47,0xFC,0x00,0x00,

//??14
0x10,0x40,0x10,0x44,0x1F,0xFE,0x20,0x40,
0x27,0xFC,0x64,0x44,0xA4,0x44,0x24,0x44,
0x27,0xFC,0x24,0x44,0x22,0x40,0x21,0x80,
0x20,0xC0,0x21,0x30,0x26,0x0E,0x28,0x04,

//??15
0x00,0x08,0x3F,0xFC,0x21,0x08,0x21,0x08,
0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,
0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,
0x21,0x08,0x41,0x08,0x41,0x28,0x80,0x10,

//??16
0x20,0x04,0x27,0xFE,0x24,0x04,0x24,0x44,
0x2C,0x44,0xB4,0x44,0xA7,0xFC,0xA4,0x44,
0x24,0x44,0x24,0xA4,0x24,0x94,0x25,0x0C,
0x56,0x0C,0x4C,0x04,0x87,0xFC,0x04,0x04,

//??17
0x01,0x00,0x01,0x00,0x05,0x40,0x0D,0x20,
0x11,0x18,0x21,0x0C,0x41,0x04,0x00,0x00,
0x01,0x00,0x01,0x08,0x7F,0xFC,0x01,0x00,
0x01,0x00,0x01,0x04,0xFF,0xFE,0x00,0x00,

//??18
0x00,0x80,0x40,0x88,0x2F,0xFC,0x21,0x00,
0x01,0x40,0x02,0x50,0xF7,0xFE,0x20,0x40,
0x20,0x40,0x20,0x48,0x2F,0xFC,0x20,0x40,
0x20,0x40,0x50,0x46,0x8F,0xFC,0x00,0x00,

//??19
0x10,0x40,0x10,0x50,0x23,0xF8,0x20,0x40,
0x48,0x40,0xFF,0xFC,0x11,0x24,0x20,0xA8,
0x42,0x20,0xF9,0x24,0x07,0xFE,0x00,0x40,
0x1C,0x60,0xE0,0x90,0x41,0x0C,0x02,0x04,

//?à20
0x04,0x40,0x04,0x40,0x24,0x48,0x24,0x7C,
0x24,0xA0,0x25,0x18,0x24,0x08,0x24,0x00,
0x04,0x08,0x3F,0xFC,0x24,0x48,0x24,0x48,
0x24,0x48,0x24,0x48,0xFF,0xFE,0x00,0x00,

//??21
0x00,0x00,0x40,0x44,0x27,0xE4,0x24,0x54,
0x85,0x54,0x65,0x54,0x25,0x54,0x0D,0x54,
0x15,0x54,0x25,0x54,0xE5,0x54,0x21,0x04,
0x22,0x84,0x24,0x44,0x28,0x54,0x20,0x08,

//??22
0x08,0x00,0x08,0x80,0x08,0x64,0x12,0x24,
0x12,0x04,0x32,0x08,0x51,0x08,0x91,0x10,
0x10,0x90,0x10,0xA0,0x10,0x40,0x10,0xA0,
0x11,0x10,0x12,0x08,0x14,0x0E,0x18,0x04,

//?à23
0x04,0x40,0x04,0x40,0x24,0x48,0x24,0x7C,
0x24,0xA0,0x25,0x18,0x24,0x08,0x24,0x00,
0x04,0x08,0x3F,0xFC,0x24,0x48,0x24,0x48,
0x24,0x48,0x24,0x48,0xFF,0xFE,0x00,0x00,

//??24
0x00,0x00,0x40,0x44,0x27,0xE4,0x24,0x54,
0x85,0x54,0x65,0x54,0x25,0x54,0x0D,0x54,
0x15,0x54,0x25,0x54,0xE5,0x54,0x21,0x04,
0x22,0x84,0x24,0x44,0x28,0x54,0x20,0x08,

//??25
0x08,0x00,0x08,0x80,0x08,0x64,0x12,0x24,
0x12,0x04,0x32,0x08,0x51,0x08,0x91,0x10,
0x10,0x90,0x10,0xA0,0x10,0x40,0x10,0xA0,
0x11,0x10,0x12,0x08,0x14,0x0E,0x18,0x04,

//??26
0x40,0x40,0x30,0x40,0x17,0xFC,0x04,0x44,
0x88,0x48,0x60,0x80,0x20,0x84,0x09,0x4C,
0x13,0x50,0x25,0x20,0xE9,0x20,0x21,0x10,
0x21,0x0E,0x21,0x44,0x21,0x80,0x21,0x00,

//??27
0x01,0x00,0x00,0x84,0x3F,0xFE,0x22,0x20,
0x22,0x28,0x3F,0xFC,0x22,0x20,0x23,0xE0,
0x20,0x00,0x2F,0xF0,0x22,0x20,0x21,0x40,
0x20,0x80,0x43,0x60,0x8C,0x1E,0x30,0x04,

//?÷28
0x00,0x80,0x40,0x48,0x37,0xFC,0x10,0x40,
0x80,0x90,0x61,0x08,0x27,0xFC,0x08,0x04,
0x11,0x50,0x21,0x50,0xE1,0x50,0x21,0x50,
0x21,0x52,0x21,0x52,0x22,0x4E,0x24,0x40,

//??29
0x00,0x40,0x40,0x44,0x37,0xFE,0x10,0x40,
0x07,0xFC,0x04,0x44,0xF4,0x44,0x17,0xFC,
0x14,0x44,0x10,0xE0,0x11,0x58,0x12,0x48,
0x14,0x40,0x28,0x46,0x47,0xFC,0x00,0x00,

//??30
0x00,0x10,0x1F,0xF8,0x10,0x10,0x1F,0xF0,
0x10,0x14,0xFF,0xFE,0x00,0x00,0x1F,0xF0,
0x11,0x10,0x1F,0xF0,0x11,0x10,0x1F,0xF0,
0x01,0x00,0x1F,0xF0,0x01,0x00,0x7F,0xFC,

//??31
0x00,0x08,0x43,0xFC,0x32,0x08,0x12,0x08,
0x83,0xF8,0x62,0x08,0x22,0x08,0x0B,0xF8,
0x10,0x00,0x27,0xFC,0xE4,0xA4,0x24,0xA4,
0x24,0xA4,0x24,0xA4,0x2F,0xFE,0x20,0x00,

//??32
0x08,0x40,0x08,0x40,0x7E,0xF8,0x09,0x10,
0x3E,0x24,0x08,0xFE,0xFF,0x24,0x00,0x24,
0x3F,0xFE,0x22,0x24,0x3E,0x24,0x22,0xFC,
0x3E,0x24,0x22,0x20,0x22,0xA0,0x26,0x40,

//??33
0x00,0x08,0x3F,0xFC,0x20,0x80,0x20,0x80,
0x20,0x80,0x20,0x80,0x20,0x88,0x2F,0xFC,
0x20,0x80,0x20,0xA0,0x20,0x98,0x20,0x88,
0x40,0x80,0x40,0x84,0x9F,0xFE,0x00,0x00,

//??34
0x00,0x08,0x47,0xFC,0x34,0x08,0x14,0x08,
0x87,0xF8,0x64,0x08,0x24,0x08,0x0F,0xF8,
0x11,0x20,0x21,0x20,0xE9,0x24,0x25,0x28,
0x23,0x30,0x21,0x24,0x3F,0xFE,0x20,0x00,

//×?35
0x08,0x40,0x08,0x50,0x08,0x48,0x48,0x40,
0x28,0x44,0x2F,0xFE,0x08,0x40,0x08,0x40,
0x18,0xA0,0x28,0xA0,0x49,0x10,0xC9,0x10,
0x09,0x08,0x0A,0x0E,0x0C,0x04,0x08,0x00,

//??36
0x01,0x00,0x01,0x04,0xFF,0xFE,0x01,0x00,
0x02,0x80,0x04,0x40,0x0A,0x30,0x31,0x0E,
0xC0,0x04,0x02,0x00,0x29,0x10,0x29,0x08,
0x28,0x24,0x48,0x24,0x07,0xE0,0x00,0x00,

//??37
0x00,0x10,0x43,0xF8,0x30,0x00,0x10,0x00,
0x00,0x08,0x07,0xFC,0xF0,0x80,0x10,0x80,
0x11,0x00,0x11,0x20,0x12,0x10,0x17,0xF8,
0x10,0x08,0x28,0x06,0x47,0xFC,0x00,0x00,

//??38
0x08,0x08,0x0B,0xFC,0x10,0x00,0x20,0x00,
0x40,0x00,0x08,0x04,0x17,0xFE,0x30,0x10,
0x50,0x10,0x90,0x10,0x10,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0x50,0x10,0x20,

//??39
0x10,0x80,0x10,0x48,0x17,0xFC,0x20,0x00,
0x23,0xF8,0x62,0x08,0xA3,0xF8,0x20,0x00,
0x2F,0xFE,0x28,0x02,0x33,0xF4,0x20,0x40,
0x20,0x40,0x20,0x40,0x21,0x40,0x20,0x80,

//?ú40
0x10,0x00,0x10,0x10,0x11,0xF8,0x11,0x10,
0xFD,0x10,0x11,0x10,0x31,0x10,0x39,0x10,
0x55,0x10,0x51,0x10,0x91,0x10,0x11,0x10,
0x11,0x12,0x12,0x12,0x14,0x0E,0x18,0x00,

//??41
0x03,0xF8,0x40,0x10,0x30,0xA0,0x10,0x48,
0x03,0xFC,0x02,0x48,0xF2,0x48,0x13,0xF8,
0x12,0x48,0x12,0x48,0x13,0xF8,0x12,0x48,
0x12,0x68,0x2A,0x50,0x44,0x06,0x03,0xFC,

//??42
0x04,0x00,0x44,0x0C,0x64,0xF0,0x55,0x40,
0x4E,0x40,0x44,0x44,0x7F,0x7E,0x44,0x48,
0x4E,0x48,0x55,0x48,0x64,0x48,0x44,0x48,
0x44,0x48,0x7F,0x48,0x40,0x88,0x01,0x08,

//??????·???43
0x00,0x00,0x00,0x00,0x3C,0x00,0x66,0x3C,
0x66,0x66,0x66,0xC2,0x66,0xC0,0x3C,0xC0,
0x00,0xC0,0x00,0xC0,0x00,0xC2,0x00,0x66,
0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,

//°?·???44
0x18,0x00,0x24,0x03,0x66,0x06,0x66,0x0C,
0x66,0x18,0x66,0x30,0x66,0x60,0x24,0xCC,
0x19,0x92,0x03,0x33,0x06,0x33,0x0C,0x33,
0x18,0x33,0x30,0x33,0x60,0x12,0x00,0x0C,

//??·??×·???45
0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x19,
0x00,0x01,0xED,0xC6,0x7F,0xE1,0x66,0x61,
0x66,0x79,0x66,0x6E,0x66,0x60,0x66,0x60,
0x66,0x60,0x66,0x60,0xF7,0x70,0x00,0x00
};
// 8X16×?·?×???±í
uint8_t flash_array2[][16]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0- -
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18, // 1-!-
0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,

0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00, // 2-"-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C, // 3-#-
0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,

0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06, // 4-$-
0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18, // 5-%-
0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00,

0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC, // 6-&-
0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,

0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00, // 7-'-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30, // 8-(-
0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,

0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C, // 9-)-
0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF, // 10-*-
0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E, // 11-+-
0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 12-,-
0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, // 13---
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 14-.-
0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18, // 15-/-
0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0xCE,0xD6,0xD6, // 16-0-
0xE6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18, // 17-1-
0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30, // 18-2-
0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06, // 19-3-
0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE, // 20-4-
0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,

0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E, // 21-5-
0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6, // 22-6-
0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18, // 23-7-
0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6, // 24-8-
0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06, // 25-9-
0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, // 26-:-
0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, // 27-;-
0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60, // 28-<-
0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00, // 29-=-
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06, // 30->-
0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18, // 31-?-
0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE, // 32-@-
0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE, // 33-A-
0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66, // 34-B-
0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,

0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0, // 35-C-
0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66, // 36-D-
0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,

0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68, // 37-E-
0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68, // 38-F-
0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,

0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE, // 39-G-
0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6, // 40-H-
0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18, // 41-I-
0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C, // 42-J-
0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,

0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78, // 43-K-
0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,

0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60, // 44-L-
0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6, // 45-M-
0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE, // 46-N-
0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6, // 47-O-
0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,

0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60, // 48-P-
0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6, // 49-Q-
0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,

0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C, // 50-R-
0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,

0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C, // 51-S-
0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18, // 52-T-
0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, // 53-U-
0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, // 54-V-
0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6, // 55-W-
0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,

0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38, // 56-X-
0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18, // 57-Y-
0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30, // 58-Z-
0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30, // 59-[-
0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38, // 60-\-
0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,

0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C, // 61-]-
0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00,

0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, // 62-^-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 63-_-
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,

0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00, // 64-`-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C, // 65-a-
0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,

0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66, // 66-b-
0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0, // 67-c-
0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC, // 68-d-
0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE, // 69-e-
0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60, // 70-f-
0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC, // 71-g-
0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,

0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66, // 72-h-
0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,

0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18, // 73-i-
0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06, // 74-j-
0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,

0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78, // 75-k-
0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00,

0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18, // 76-l-
0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6, // 77-m-
0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66, // 78-n-
0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6, // 79-o-
0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66, // 80-p-
0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,

0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC, // 81-q-
0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00,

0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62, // 82-r-
0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60, // 83-s-
0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,

0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30, // 84-t-
0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC, // 85-u-
0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66, // 86-v-
0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6, // 87-w-
0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38, // 88-x-
0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6, // 89-y-
0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00,

0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18, // 90-z-
0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18, // 91-{-
0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,

0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18, // 92-|-
0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,

0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18, // 93-}-
0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,

0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00, // 94-~-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0xFF,0xFF,0x7E,0x7E,0x3C,0x3C,0x18, //?ì??·???95
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00
};

//////////qvfb_test.c///////////

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "hzfont.h"

typedef struct {
int left, top, right, bottom;
} RECT;

typedef unsigned char BYTE;

typedef struct {
int width;
int height;
int depth;
int linestep;
int dataoffset;
RECT update;
BYTE dirty;
int numcols;
unsigned int clut[256];
} QVFbHeader;

/* display 汉字 */
void displayhz(QVFbHeader * qvfb, int x, int y, int code, int color)
{
int i, j, k = 0;
uint32_t *fb = (uint32_t *) qvfb;
uint32_t *fp;
fb = (uint32_t *) ((int) fb + qvfb->dataoffset + y * qvfb->linestep + x * qvfb->depth / 8);

fp = fb;
for (i = 0; i < 16; i++) { //16 行
/* 左边 */
for (j = 0; j < 8; j++) { //左8 列
if (flash_array1[code][k] & (0x80 >> j))
fp[j] = color;
else
fp[j] = 0;
}

k++;

/* 右边 */
for (j = 0; j < 8; j++) { //右8列
if (flash_array1[code][k] & (0x80 >> j))
fp[8 + j] = color;
else
fp[8 + j] = 0;
}
k++;
fp += (qvfb->linestep / 4); //换到下一行
}
}

/* display a bmp picture */

void displaybmp(QVFbHeader * qvfb, int x, int y, char *file)
{
/* step 1 :
* obtain file stat and point to data area
*/
int fd = open(file, O_RDONLY);
struct stat st; //save the statment of the file
int i, j;
unsigned long color;
fstat(fd, &st); //use st to save of the statment of the file
unsigned char *fp, *bp = malloc(st.st_size); // use bp to save the file

fp = bp; //use fp to loop as temp
read(fd, bp, st.st_size); //save to bp

unsigned long *fb = (unsigned long *) ((int) qvfb + qvfb->dataoffset + y * qvfb->linestep + x * qvfb->depth / 8); //计算指向结果的偏移量

printf("%c%c\n", bp[0], bp[1]); //test if the file if bmp file

bp += 0x36; //jump to the data of picture major

fb += qvfb->linestep / 4 * 400; //到最后一行, 每行有linestep个字节数, 每个点由4个字节组成

/* step 2:
* print every point
*/
/* 打印每一个点 */
for (i = 0; i < 400; i++) { //400 行
for (j = 0; j < 500; j++) { //500 列
color = 0; //背景色
/* 调色 */
color = *bp++; //指向蓝色
color |= (*bp++) << 8; //三个字节表示一个点 //补充绿色上去
color |= (*bp++) << 16; //红色部分;

fb[j] = color;
}

fb -= (qvfb->linestep / 4); //每行存多少个点
}
free(fp);
close(fd);
}

int main(void)
{
int i;
key_t key;
int shmid;
QVFbHeader *qvfb;

key = ftok("/tmp/.qtvfb_mouse-0", 'b');

shmid = shmget(key, 0, 0);
if (shmid != -1)
qvfb = (QVFbHeader *) shmat(shmid, 0, 0);

if ((int) qvfb == -1 || qvfb == NULL)
return -1;

#if 1
/* display Hanzi */
for(i=0;i<41;i++)
displayhz(qvfb,i*16,100,i,0x00ffff00);
#endif

#if 0
/* display a picture */
displaybmp(qvfb,50,50,"Background.bmp");
#endif

#if 0
/* display a picture */
displaybmp(qvfb, 50, 50, "girl.bmp");
#endif

#if 0
/*printf a line */
printf("width :%d\n", qvfb->width);
printf("height :%d\n", qvfb->height);
printf("depth :%d\n", qvfb->depth);
printf("dataoffset:%d\n", qvfb->dataoffset);
#endif
shmdt(qvfb);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐