nopnop2002 / esp-idf-st7789

ST7789 Driver for esp-idf
MIT License
254 stars 62 forks source link

Need to erase some data values #47

Open arunyava opened 13 hours ago

arunyava commented 13 hours ago

Hi, This post was not and issue. I need some help for clearing the data. I will write some string value to display. for example i wrote WELCOME' string on display. I want to erase E and M on the display. How can i achieve this. Thanks in advance!

nopnop2002 commented 6 hours ago

If you draw the same character in the same position with the same color as the background color, it will disappear.

// get font width & height
uint8_t buffer[FontxGlyphBufSize];
uint8_t fontWidth;
uint8_t fontHeight;
GetFontx(fx16G, 0, buffer, &fontWidth, &fontHeight);

lcdFillScreen(&dev, BLACK);
strcpy((char *)ascii, "WELCOME");
lcdDrawString(&dev, fx16G, xpos, ypos, ascii, WHITE);
vTaskDelay(1000);
strcpy((char *)ascii, "E");
lcdDrawString(&dev, fx16G, xpos+(fontWidth*1), ypos, ascii, BLACK);
lcdDrawString(&dev, fx16G, xpos+(fontWidth*6), ypos, ascii, BLACK);
strcpy((char *)ascii, "M");
lcdDrawString(&dev, fx16G, xpos+(fontWidth*5), ypos, ascii, BLACK);