Hi everyone,
I need to update the style of an image. For instance, there is a left signal indicator in my screen, which is only white image and its opacity is 50 by default, when get the message from UART, then have to change its value as OPA_100. How can I do this? Where can I update its value, for example in while loop it can be? Please give me an example.
While trying the following code in PC simulator in ubuntu with Eclipse IDE, there is no changes for image?
while(1) {
/* Periodically call the lv_task handler.
* It could be done in a timer interrupt or an OS task too.*/
lv_timer_handler();
usleep(5 * 1000);
if(b_state_on == 1){
lv_style_set_img_recolor(&style_icon_left_right, lv_color_make(0xb2, 0x01, 0x01));
lv_style_set_img_recolor_opa(&style_icon_left_right, LV_OPA_100);
}else{
lv_style_set_img_recolor(&style_icon_left_right, lv_color_make(0xff, 0xff, 0xff));
lv_style_set_img_recolor_opa(&style_icon_left_right, LV_OPA_50);
}