Set and show a background image on the display


My apologies for my previous posting of this in another category. I’m trying this one instead.

I’m new to lvgl. I’m doing some prototyping on a Raspberry Pi trying to get a grip of lvgl. My purpose is to make overlays for a video camera.

I’m on release/v8.3
I’m following the LVGL Documentation 8.0 (downloaded the pdf)
I’ve started with this: Embedded GUI Using Linux Frame Buffer Device with LVGL | LVGL’s Blog

I have it up running to some extent. I’ve managed to display images on the active screen, moving labels around, setting the screen background color. But when it comes to making the screen transparent to be able to see the the display background I’m lost. Setting the screen background color to transparent does not help.

    lv_disp_set_bg_image(NULL, "S:image.png");

    lv_color_t c; = 50; = 0; = 150; = 10;
    lv_obj_set_style_bg_color(scr, c, LV_PART_MAIN);

It looks like the alpha channel makes no difference.

Then I thought I should try something else…
In the section 4.9.2 Screens, Transparent screens, I see the following code example:

• Set the screens opacity to LV_OPA_TRANSP e.g. with


However, in this branch there is no function lv_obj_set_style_local_bg_opa().
Also, LV_OBJMASK_PART_MAIN is undeclared.

I’ve been googling around trying to find a solution but the examples I can find are related to the code example above which I guess comes from an older version of lvgl.

Should I revert to an old version of lvgl or can some one please help me?