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
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.
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.
Dear Paolog, could you please contact me back? Im trying to make the SSD2805 work with ESP but its not cooperating with me. Maybe you can help me a bit. Would be amazing.
That sounds like an issue with the object’s transformation area or how the parent container is refreshing. In LVGL, when you rotate an image, the bounding box changes, and if the background isn’t redrawing correctly within that new area, you get those weird artifacts. You might want to check if lv_obj_set_style_clip_corner is interfering or if the image source itself has enough padding to handle the rotation.
One thing I usually do to simplify the math is to make sure the image asset is already oriented as close to the target angle as possible before importing it into the project. If you’re just trying to get a static 90 or 180-degree turn, it’s often easier to just rotate the image online and re-convert it to a C array. It saves a lot of MCU overhead compared to doing the transformation in real-time.