Description
I have an ESP32 with a monochrome display with an SSD1603 controller.
I would like create kind of status bar on the top part of the display where I would like to draw the text “inverted” (so the background is the filled, and the text just leaves out the pixels).
What MCU/Processor/Board and compiler are you using?
esp32, monochrome OLED 128x64 with an SSD1603
What LVGL version are you using?
7.9.0
What do you want to achieve?
I would like create kind of status bar on the top part of the display where I would like to draw the text “inverted” (so the background is the filled, and the text just leaves out the pixels).
What have you tried so far?
Tried to create a new style for an label and add that style to the label, but that did not really make any difference.
Code to reproduce
lv_obj_t * label1 = lv_label_create(scr, NULL);
static lv_style_t style;
lv_style_init(&style);
lv_style_set_text_color (& style, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_style_set_bg_color (& style, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_obj_add_style(label1, LV_LABEL_PART_MAIN, &style);
lv_label_set_text(label1, "Status Bar");
lv_obj_set_pos (label1, 10, 1);