Using the agif demo, you can replace APNG with a static PNG or rotate it by a certain angle. If you want to rotate both GIF animations and MP4 videos around their center by a specific angle, how should you proceed?
@yxhuang Refer to this link; I feel that rotating by an angle during the final rendering gives me the desired effect, but I don’t know how to modify it. Also, this angle is a configurable parameter that can be adjusted anytime.
@HalfSweet Please take a look, I’m in a hurry!
If it’s just rotating a single image widget, you should directly use LVGL’s image rotation feature.
- For video, LVGL handles it in YUV or RGB format, and our hardware can directly perform the rotation.
- For formats like GIF or PNG, you can utilize LVGL’s canvas by first drawing onto a buffer and then rotating the buffer.
Can you help me debug the demo? It’s quite challenging for me as a beginner.
-
Here is an image rotation and scaling animation example. However, it also uses
lv_animto create an animation. If you only need direct rotation without animation, you can skip the animation part and simply call**lv_img_set_zoom(img, v);**to rotate the image. -
For rotating using a canvas, here is a sample:
In this example, a canvas is created, on which a rectangle and a label are drawn, and then an image is rotated.