Closed holgerlembke closed 1 year ago
Working solution is to unroll the code from another function into this. Like.
void DrawPng(PNGDRAW *pDraw) {
uint16_t usPixels[320];
uint8_t usMask[320];
pngparam->png.getLineAsRGB565(pDraw, usPixels, PNG_RGB565_LITTLE_ENDIAN, 0x00000000);
pngparam->png.getAlphaMask(pDraw, usMask, 1);
int y = pDraw->y + yOffset;
uint8_t byte = 0;
gfx->startWrite();
for (int16_t i = 0; i < pDraw->iWidth; i++) {
if (i & 7) {
byte <<= 1;
} else {
byte = usMask[i / 8];
}
if (byte & 0x80) {
gfx->writePixel(xOffset + i, y, usPixels[i]);
}
}
gfx->endWrite();
}
added to todo lost
Please get update and try again.
I want to display png-graphics on one of those ESP32-S3 HMI 800x480 boards. I follow the ImgViewerPng-Example.
To show the problem I created the following condensed example. It will not compile. I do not understand why.