How to draw a fan mask?


I want to make a demo of a car instrument, and I want to achieve a fan-shaped mask effect that the pointer passes over. How to achieve it on lvgl?

What LVGL version are you using?


I want like this:

Can LVGL do it?

Following! Would be nice if it could do the trail on needle movement only.
I’ve seen it done in Qt, seems quite a neat look&feel

It would be a pleasing effect; I’ll look into it this weekend.

Okay; here’s what I’ve come up with.

You can’t do this using LVGL directly because there isn’t a way to draw an arc with a gradient (as opposed to a solid color). A few months ago someone posted some pictures of an implementation and offered to share the code but didn’t seem to respond after that.

I’m sure we’d be open to adding that feature in the future, but focus is currently on optimizations and architecture improvements.

An alternative solution could be to use an image and rotate it, however, there are performance limitations when rotating an image and you would not be able to animate the length of the mask.

I’ll think about this some more and post if I come up with any other approach.

Thank you for your reply, and hope to release this feature in the near future.