1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

Support simple transparent pngs for display (#3035)

This commit is contained in:
Jesse Hills
2022-01-21 11:16:18 +13:00
committed by GitHub
parent 1c51cac5ba
commit 045952939e
3 changed files with 26 additions and 1 deletions

View File

@@ -233,6 +233,14 @@ void DisplayBuffer::image(int x, int y, Image *image, Color color_on, Color colo
}
}
break;
case IMAGE_TYPE_TRANSPARENT_BINARY:
for (int img_x = 0; img_x < image->get_width(); img_x++) {
for (int img_y = 0; img_y < image->get_height(); img_y++) {
if (image->get_pixel(img_x, img_y))
this->draw_pixel_at(x + img_x, y + img_y, color_on);
}
}
break;
}
}