Is there a way to rotate the GIF animation and MP4 video controls by an angle?

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.

  1. For video, LVGL handles it in YUV or RGB format, and our hardware can directly perform the rotation.
  2. 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.

  1. Here is an image rotation and scaling animation example. However, it also uses lv_anim to 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.

  2. 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.