Rotating an image affects the background image

Description

Hi! I’m working on a clock project, and I started from posts I found in this forum on how to do it. My clock has a background image and chrome-keyed images for hands. Hands are moved using lv_img_set_angle() function. I’m using a double buffer of 10 display lines each.

When the hand is redrawn, the background image is modified, like it’s part of the copy-rotate-redraw process, together with the hand image. Any idea about how it comes from and how to avoid it?

Thank you for your suggestions.

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

ESP32/PlatformIO/ESP-IDF
Display is AMOLED MIPI 454x454 connected via SSD2805 adapter, commands sent by SPI

What LVGL version are you using?

7.9.1

What do you want to achieve?

Clean image rotation

What have you tried so far?

Code to reproduce

Screenshot and/or video

Read the manuals, read the manuals, read the manuals…

Ok, reading the manuals of my display controller, I found out that the limits of the area to be updated have contraints, specifically:

  • start column and row must be even
  • (end - start + 1) must be even for row and column

So I created a rounder callback function to make the necessary changes to these limits, and all is working fine!

Just in case this is happening to someone else… :slight_smile:

Hi, I know this thread is nearly one year old, but do you have the source code somewhere available? Currently I’m planning something similar (two images: one background, one (clock)hand being rotated) to create a gauge for a RPM counter. I’m using the GC9A01 driver and it looks like LVGL is the only library that supports rotating images to an specific angle.

Thanks

If you’re looking for the rounder callback source code, there’s an example here that should be helpful. It makes the area dimensions a multiple of 8 but you should be able to adapt it easily.