Draw widget into a memory buffer

Hello, I searched the documentation of LVGL for a way to draw a full widget to a memory buffer instead of a display and have not found a lot. I’ve searched the documentation and found canvas, screens and displays and all of them don’t seem to really fit my idea.

The only thing that would probably work is having a separate dummy display, use this display buffer as a pointer in an image object and then use this image object somehow. But this seems to invite a lot of problems and hackery to work around them, since it is very far away from the intended usage.

What are your ideas? :grin:

Can you just create a new screen and add your widget there, without displaying the screen?

With just using a screen I don’t see a possibility to do anything useful with it. My preferred mechanism would be to have something like a SDL render target or even an emWin memory device, which you can set as the output of a widget renderer.

But the more I think about it the less I believe in this idea. My motivation for this is to have a widget be a standalone thing that can exist, react and get rendered, but with the hierarchical structure of LVGL, this is just not feasible. It would be cool and you could wrap a widget within your own widget and manipulate the input and output of the widget inside, but that’s not how it works currently. I also don’t know enough about LVGL to make any sensible proposal how this would have to look like :frowning: