display 32-bit BMP files

This commit is contained in:
prenticedavid
2021-07-14 08:04:37 +01:00
parent ce13d267aa
commit aa99fe16bf
2 changed files with 4 additions and 0 deletions

View File

@@ -217,10 +217,12 @@ uint8_t showBMP(char *nm, int x, int y)
r = 0;
}
switch (bmpDepth) { // Convert pixel from BMP to TFT format
case 32:
case 24:
b = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
r = sdbuffer[buffidx++];
if (bmpDepth == 32) buffidx++; //ignore ALPHA
color = tft.color565(r, g, b);
break;
case 16:

View File

@@ -231,10 +231,12 @@ uint8_t showBMP(char *nm, int x, int y)
r = 0;
}
switch (bmpDepth) { // Convert pixel from BMP to TFT format
case 32:
case 24:
b = sdbuffer[buffidx++];
g = sdbuffer[buffidx++];
r = sdbuffer[buffidx++];
if (bmpDepth == 32) buffidx++; //ignore ALPHA
color = tft.color565(r, g, b);
break;
case 16: