Problem of `lv_img_set_zoom`

Hi,
I found that after using the lv_img_set_zoom API, the size attribute of the image cannot be changed;

image = lv_img_create(btn,NULL);
lv_img_set_auto_size(image,true);
lv_img_set_src(image,"./test.png");
lv_img_set_zoom(image,192);
printf("img height %d\r\n",lv_obj_get_width(image));

The png is 128px,but the size get by lv_obj_get_width(image) Still 128,i think it should be 96,whether it should be able to adjust automatically is more reasonable ?

As far as I know, lv_img_set_zoom only changes the virtual size of the image, not the logical size reported by width/height.

1 Like