1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
void AfficheTemp()
{
display.setRotation(1);
display.setFont(&FreeSerifBoldItalic24pt7b);
display.setTextColor(GxEPD_BLACK);
int16_t tbx, tby; uint16_t tbw, tbh;
display.getTextBounds(String(piscine,1), 0, 0, &tbx, &tby, &tbw, &tbh);
// center the bounding box by transposition of the origin:
uint16_t x = ((display.width() - tbw) / 2) - tbx;
uint16_t y = ((display.height() - tbh) / 2) - tby;
display.setFullWindow();
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.setCursor(x, y-tbh);
display.print(String(piscine,1));
display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
x = ((display.width() - tbw) / 2) - tbx;
}
while (display.nextPage());
}
.../....
void AfficheBitMaps()
{
const unsigned char* bitmaps[] =
{
gImage_gui
};
if (display.epd2.panel == GxEPD2::GDEH0154D67)
{
bool m = display.mirror(true);
for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
{
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
}
while (display.nextPage());
delay(2000);
}
display.mirror(m);
}
} |
Partager