How to resize and cut corner to a image at the same time


I am using images in my project, i will convert 100x100 image into a screen and want to resize it to 40x40 and make round icon, so it would be radius corner cut operation at the same time. But after i zoom it and cut it again, the corner is weird and i dont know how to combine the functions correctly.

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

resize and circle cut the image at the same time

What have you tried so far?

set zoom / set radius / clip corner

Code to reproduce

lv_obj_t *iconImg = lv_img_create(box);
lv_img_set_src(iconImg, xxx);
lv_img_set_pivot(iconImg, 50, 50);
lv_obj_set_pos(iconImg, 0, 30);
lv_obj_set_size(iconImg, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_img_set_zoom(iconImg, 40*255/100);
lv_obj_set_style_radius(iconImg, LV_RADIUS_CIRCLE, 0);
lv_obj_set_style_clip_corner(iconImg, true, 0);

Screenshot and/or video