Change images to DIFs for faster drawing

This commit is contained in:
Pim van Pelt
2017-12-02 12:22:14 +01:00
parent ff84c5aa4b
commit 4e1a9f4c2a
6 changed files with 3 additions and 3 deletions

BIN
fs/flowers.dif Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
fs/mongoose-os.dif Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -37,7 +37,7 @@
"w": 128, "w": 128,
"h": 98, "h": 98,
"type": 1, "type": 1,
"img": "/mongoose-os.png" "img": "/mongoose-os.dif"
}, },
{ {
"name": "flowers", "name": "flowers",
@ -46,7 +46,7 @@
"w": 106, "w": 106,
"h": 98, "h": 98,
"type": 1, "type": 1,
"img": "/flowers.png" "img": "/flowers.dif"
} }
] ]
} }

View File

@ -12,7 +12,7 @@ static void widget_default_draw(struct widget_t *w, uint16_t color) {
if (w->img) { if (w->img) {
mgos_ili9341_set_fgcolor565(ILI9341_BLUE); mgos_ili9341_set_fgcolor565(ILI9341_BLUE);
mgos_ili9341_drawRoundRect(0, 0, w->w, w->h, 16); mgos_ili9341_drawDIF(0, 0, w->img);
} else if (w->label) { } else if (w->label) {
int16_t text_width, text_height; int16_t text_width, text_height;
uint16_t x, y; uint16_t x, y;