Image zoom with percentage

Is there any way to use lv_pct in lv_img_set_zoom?

No, because the current method also works like percentage.

  • 256 = 100%
  • 512 = 200%
  • etc
1 Like

How to change image size automatically? For example: I have an object with 300x200 and an image (inside the object) 400x300, but I want this image to automatically resize to the width and height of the parent object, without any manual procedure, as I will have to adjust the size of the image each time that the size of the object is changed. Can I do this with events? For example: Each time the object size is changed, adjust the image size.

@Miguel_0101 @kisvegabor did you figure this out? I am also running into a similar question. ie if I want an image of any size to resize nicely to fit 300x200 is there a way to have it resize automatically or do I need to get the size of the image, figure out the % to scale to the target size and adjust zoom?

It’s not implemented yet. :slightly_frowning_face:

Yes, you can do it like this for now.