Skip to content

Is there an easy way to clear area buffer? #1719

Answered by olikraus
Berkays asked this question in Q&A
Discussion options

You must be logged in to vote

UpdateDisplayArea acts more like a post processing filter: Only pixel data within the specified rectangle will be uploaded to the display.
Bitmap data on the display outside the specified rectangle is just kept as it is.
I mean, you should have some code like this:

  u8g2.setFont(u8g2_font_ncenB14_tr);
  u8g2.firstPage();
  do {
    u8g2.setCursor(0, 20);
    u8g2.print(F("Hello World!"));
  } while ( u8g2.nextPage() );

If you just want to update a part of the display (for performance reasons for example), then you just keep the loop, but prefix this with UpdateDisplayArea:

  u8g2.UpdateDisplayArea(...);
  u8g2.setFont(u8g2_font_ncenB14_tr);
  u8g2.firstPage();
  do {
    u8g2.setCursor(…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Berkays
Comment options

Answer selected by Berkays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants