![]() ![]() Lv_color_t Equal to lv_color1/8/16/24_t according to color depth settings Lv_color32_t A structure to store R (8 bit),G (8 bit), B (8 bit) components for 24-bit colors (4 byte) Lv_color16_t A structure to store R (5 bit),G (6 bit),B (5 bit) components for 16-bit colors (2 byte) Lv_color8_t A structure to store R (3 bit),G (3 bit),B (2 bit) components for 8-bit colors (1 byte) For compatibility, it also has R, G, B fields but they are always the same value (1 byte) The following variable types are defined by the color module: ![]() The color module handles all color-related functions like changing color depth, creating colors from hex code, converting between color depths, mixing colors, etc. Set the display opacity to LV_OPA_TRANSP with lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP) with lv_obj_set_style_local_bg_opa(lv_scr_act(), LV_OBJMASK_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP) Set the screens opacity to LV_OPA_TRANSP e.g. In summary, to enable transparent screen and displays to create OSD menu-like UIs:Įnable LV_COLOR_SCREEN_TRANSP in lv_conf.h The Alpha channel of 32-bit colors will be 0 where there are no objects and will be 255 where there are solid objects. To handle transparent displays special (slower) color mixing algorithms needs to be used by LVGL so this feature needs to enabled with LV_COLOR_SCREEN_TRANSP n lv_conf.h.Īs this mode operates on the Alpha channel of the pixels LV_COLOR_DEPTH = 32 is also required. This configuration (transparent screen ans display) could be used to create for example OSD menus where a video is played to lower layer, and menu is created on an upper layer. If the display's background opacity is also not LV_OPA_COVER LVGL has no solid background to draw. See the Display background section for more details. If it's not the case (opacity < 100%) the display's background color or image will be visible. Usually, the opacity of the screen is LV_OPA_COVER to provide a solid background for its children. Screens can be deleted with lv_obj_del(scr), but ensure that you do not delete the currently loaded screen. Screen can be loaded with animations too. If you want to to specify which display to work on, use lv_disp_get_scr_act(disp) and lv_disp_load_scr(disp, scr). These functions works on the default display. To get the active screen, use lv_scr_act(). To create a screen, use lv_obj_t * scr = lv_create(NULL, copy). lv_obj_set_pos(), lv_obj_set_size() or similar functions can't be used on screens.Ī screen can be created from any object type but, the two most typical types are the Base object and the Image (to create a wallpaper). Therefore, the screens coordinates can't be changed, i.e. The screen's size is always equal to its display and size their position is (0 0). Screens can be considered the highest level containers which have no parent. One display can have multiple screens associated with it, but not vice versa. Screens are the high-level root objects associated with a particular display. Every display has each set of Screens and the object on the screens.īe sure not to confuse displays and screens:ĭisplays are the physical hardware drawing the pixels. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |