mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-09 23:54:43 +02:00
Fix #346
This commit is contained in:
@@ -34,6 +34,7 @@ void drawBmp(const char *filename, int16_t x, int16_t y) {
|
|||||||
{
|
{
|
||||||
y += h - 1;
|
y += h - 1;
|
||||||
|
|
||||||
|
bool oldSwapBytes = tft.getSwapBytes();
|
||||||
tft.setSwapBytes(true);
|
tft.setSwapBytes(true);
|
||||||
bmpFS.seek(seekOffset);
|
bmpFS.seek(seekOffset);
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ void drawBmp(const char *filename, int16_t x, int16_t y) {
|
|||||||
// y is decremented as the BMP image is drawn bottom up
|
// y is decremented as the BMP image is drawn bottom up
|
||||||
tft.pushImage(x, y--, w, 1, (uint16_t*)lineBuffer);
|
tft.pushImage(x, y--, w, 1, (uint16_t*)lineBuffer);
|
||||||
}
|
}
|
||||||
|
tft.setSwapBytes(oldSwapBytes);
|
||||||
Serial.print("Loaded in "); Serial.print(millis() - startTime);
|
Serial.print("Loaded in "); Serial.print(millis() - startTime);
|
||||||
Serial.println(" ms");
|
Serial.println(" ms");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user