What MCU/Processor/Board and compiler are you using?
simulator
What LVGL version are you using?
v8.3
What do you want to achieve?
Why does using “lv_style_set_transform_zoom” cause the control to disappear? I used it for a button control, when I press it, the control disappears, did I miss the code?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
I want to make sure you are aware that the zoom function is a 0 to 255 number that is scaled for 0% to 100%… so if you wanted to use percentages it would be uint8_t (percentage * 2.55f)
Thanks for your reply.In fact, no matter what value I set, as long as I use “transform_zoom” or “transform_angle” for the object, the object will disappear and will no longer be displayed on the screen, but “transform_width” is valid.
instead of using a style try setting it directly on the object using lv_obj_set_style_transform_zoom. Maybe there is an issue with it in the styles but not if it gets set directly on the object.
I’m sorry to reply to you for so long, I’ve been very busy recently. I have tried your thoughts before, in fact LVGL files have lv_example_style_15.c example in the LVGL file, my Visual Studio Simulator cannot display it on the screen normally. So I’m wondering if it needs any changes in the display side to make the transform_zoom display normally.
I do want to let you know that you are using example code for version 9.0 and not version 8.3. Tho the contents of that example are identical in this case I wanted to make sure that you use examples that are for the LVGL version you are using.
I did also want to mention that you are not using the same code that is in the example. You have modified the code. Have you tried running the code as is without making any changes to it?
obj_set_style_transform_pivot_x and obj_set_style_transform_pivot_y are only going to work with obj_set_style_transform_angle
by setting obj_set_style_transform_zoom to 10 you are making the button 3.9% of it’s normal size. This is too small for LVGL to display hence the reason why the button ends up not being able to be seen.
Thank you for your reply, I’m actually using the code of 8.3, this sample code has not changed from version 9.0, so I directly shared the code of 9.0. This is the display case before I changed it.