lv_obj_set_size(lv_desktop_dep_mode[index], 40, 40);// 设置图标大小 lv_obj_set_style_img_recolor_opa(lv_desktop_dep_mode[index], 255, LV_PART_MAIN | LV_STATE_DEFAULT);// 设置图标颜色不透明度 lv_obj_set_style_img_recolor(lv_desktop_dep_mode[index], desktop_icon[index].value, ...
可以使用image_recolor和image_recolor_opa属性在每种状态下为图像重新着色。例如,如果按下该按钮可使图像变暗。 用法# 图片来源# 调用lvgl.imgbtn_set_src(imgbtn, lvgl.BTN_STATE_..., &img_src) 将图像设置为一种状态。除了“图像”按钮不支持“符号”之外,图像源的工作原理与 图像对象 中所述的相同。
"Image Button");lv_obj_set_style_img_recolor_opa(imgbtn, LV_OPA_30, LV_STATE_PRESSED);lv_obj_set_style_img_recolor(imgbtn,lv_color_black(), LV_STATE
LV_STATE_PRESSED, however it doesn't work. Have tried setting the style on both the button & the image. Will only recolor with the style set on the image with LV_STATE_DEFAULT. If the style is set on the button it doesn't seem to cascade to the image (even for LV_STATE_DEFAULT)...
(intense_slider); lv_obj_set_style_image_recolor_opa(img1, intense, 0); lv_obj_set_style_image_recolor(img1, color, 0); } static lv_obj_t * create_slider(lv_color_t color) { lv_obj_t * slider = lv_slider_create(lv_screen_active()); lv_slider_set_range(slider, 0, 255);...
(lv_app_img, ) ;/* 居中 */lv_obj_center(lv_app_img) ;/* 设置图像重着色的强度 */lv_obj_set_style_bg_img_recolor_opa(lv_app_img,255, LV_PART_MAIN) ;/*设置一个颜色混合到背景图像 */lv_obj_set_style_bg_img_recolor( lv_app_img,lv_color_make(255,255,255), LV_STATE_DEFAULT...
Image RGB,45 Image RGB + opa,29 Image ARGB,35 Image ARGB + opa,31 Image chorma keyed,41 Image chorma keyed + opa,31 Image indexed,25 Image indexed + opa,22 Image alpha only,27 Image alpha only + opa,23 Image RGB recolor,30
Image recoloring: I'm still thinking about handling with layers. So create a layer, have an image recolor draw task, and blend the recolored image. The other option is to recolor on the fly while blending (as now). Could you comment on how it works with the GPUs?
(&draw_task->area, &a, LV_ALIGN_CENTER, 0, 0); lv_draw_image_dsc_t img_draw_dsc; lv_draw_image_dsc_init(&img_draw_dsc); img_draw_dsc.src = &img_star; img_draw_dsc.recolor = lv_color_black(); if(pressed) img_draw_dsc.recolor_opa = LV_OPA_30; lv_draw_image(base_dsc...
lv_obj_t * logo = lv_img_create(tab_btns); //在标签按钮控件内创建一个image LV_IMG_DECL...