Custom characters for TFT display DFR0664
Hello,
Could you, please, document the way and tools that can be used to create custom bitmap characters that will be displayed with DFRobot_GDL library?
I tried Gimp, Image2CCP and LCD assistand but the generated bitmap sequense is displayed wrong on this TFT.
Thank you, Mihai
In DFRobot_GDL library, section wiki/English, I fount this explanation:
void DFRobot_GDL::drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[],int16_t w, int16_t h, uint16_t color)
Description: drawXBitmap draw PROGMEM-resident XBitMap Files (*.xbm), exported from GIMP. Usage: Export from GIMP to *.xbm, rename *.xbm to *.c and open in the editor. C Array can be directly used with this function. There is no RAM-resident version of this function; if generating bitmaps in RAM, use the format defined by drawBitmap() and call that instead. Draw a monochrome bitmap at the specified x, y position (top left corner of the bitmap). Some parts of the bitmap may not be displayed within the display boundary. bitmap: bitmap array. w, h are the height and width of the bitmap; color 16-bit 5-6-5 to draw monochrome image with. Now, I used Gimp to generate the byte array, then I used the example from https://github.com/DFRobot/DFRobot_GDL/tree/master/examples/Basic/icon In file Icon.h I added the byte array generaded by Gimp and then I compile the skatch using Arduino IDE and FireBeetle 2 ESP32-C6 dev board (I used GDL port to comunicate with the TFT 240x320 DFR 0664).The result is the attached picture below:This pictute should be BT symbol, downloaded from https://www.iconarchive.com/show/material-icons-by-pictogrammers/bluetooth-off-icon.html, 32x32 pixels format.The downloaded BT symbol was upladed then in Gimp, and from there was saved using .xbm format. Then, the byte array was copied in the Icon.h file. The icon.ino file was modified to access the new icon and the result in a wrong displaying.
This is the generated byte array, from Gimp:
//BLE icon;
const unsigned char gImage_17[128] PROGMEM= { /* 0X20,0X01,0X20,0X00,0X20,0X00, */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00,
0xc0, 0x80, 0x0f, 0x00, 0xc0, 0x81, 0x1f, 0x00, 0x80, 0x83, 0x3d, 0x00,
0x00, 0x87, 0x79, 0x00, 0x00, 0x0e, 0x71, 0x00, 0x00, 0x1c, 0x38, 0x00,
0x00, 0x38, 0x1c, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, 0xe0, 0x00, 0x00,
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x9c, 0x39, 0x00,
0x00, 0x8e, 0x71, 0x00, 0x00, 0x87, 0xf9, 0x00, 0x80, 0x83, 0xfd, 0x01,
0x00, 0x81, 0x9f, 0x03, 0x00, 0x80, 0x0f, 0x03, 0x00, 0x80, 0x07, 0x00,
0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
This is the function from icon.ino:
screen.drawXBitmap(16, 200, gImage[17], 32, 32, 0xffff);
What should I do in this case? How I can generate the custon icons for this combination on TFT display and ESP32-C6?
Thank you,
Mihai
Mihai.Popa