diff --git a/radio/src/gui/128x64/bmp.cpp b/radio/src/gui/128x64/bmp.cpp index 3a78b82b7..81f352e00 100644 --- a/radio/src/gui/128x64/bmp.cpp +++ b/radio/src/gui/128x64/bmp.cpp @@ -129,10 +129,11 @@ uint8_t * lcdLoadBitmap(uint8_t * bmp, const char * filename, uint8_t width, uin memset(dest, 0, BITMAP_BUFFER_SIZE(w, h) - 2); - uint8_t rowSize = (w + 7) / 8; + uint8_t rowSize; switch (depth) { case 1: + rowSize = ((w + 31) / 32) * 4; for (int8_t i=h-1; i>=0; i--) { result = f_read(&bmpFile, buf, rowSize, &read); if (result != FR_OK || read != rowSize) { diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index 00d64a9c8..4a21dc205 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -922,15 +922,34 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const uint8_t * img, uint8_t idx, L const uint8_t * q = img; uint8_t w = *q++; uint8_t hb = ((*q++) + 7) / 8; + uint8_t yShift = y % 8; + bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false); + q += idx*w*hb; + for (uint8_t yb = 0; yb < hb; yb++) { + uint8_t *p = &displayBuf[(y / 8 + yb) * LCD_W + x]; + for (coord_t i=0; i> yShift)) | (b >> (8 - yShift)); + } + } } + p++; } } } diff --git a/radio/src/lua/api_lcd.cpp b/radio/src/lua/api_lcd.cpp index cdc210f04..039aa5547 100644 --- a/radio/src/lua/api_lcd.cpp +++ b/radio/src/lua/api_lcd.cpp @@ -541,7 +541,7 @@ Draw a bitmap at (x,y) @param name (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) -@notice Only available on Taranis X9 series. Maximum image size if 106 x 64 pixels (width x height). +@notice Maximum image size is [display width / 2] x [display height] pixels. @status current Introduced in 2.0.0 */