求助使用Adafruit_GFX.h库中drawBitmap函数显示中文?请教如何正确显示中文,汉字短字
const unsigned char PROGMEM ICON_BITMAP_65[] = {
0x80,0x90,
0x60,0x88,
0x18,0x87,
0x07,0xFC,
0x08,0x84,
0x30,0x84,
0x00,0x80,
0x40,0x02,
0x45,0xF2,
0x59,0x12,
0x41,0x12,
0x41,0x12,
0x51,0x12,
0x4D,0xF2,
0x40,0x02,
0x00,0x00,
};
如下文程序现实的结果为向右转了90度
void Adafruit_GFX::drawBitmap(int16_t x, int16_t y,
const uint8_t *bitmap, int16_t w, int16_t h,
uint16_t color) {
int16_t i, j, byteWidth = (w + 7) / 8;
for(j=0; j<h; j++) {
for(i=0; i<w; i++ ) {
if(pgm_read_byte(bitmap + j * byteWidth + i / 8) & (128 >> (i & 7))) {
drawPixel(x+i, y+j, color);
}
}
}
}
|