Rendering Kivy Window as Image

21 views
Skip to first unread message

Peter Milani

unread,
Apr 17, 2024, 10:43:36 PMApr 17
to Kivy users support
Hi All,

I'm wanting to extract the kivy window render as an image so that I can send this to a hardware specific display driver, which only accepts images.

Specifically, I want to render using an Raspberry Pi on an eInk Screen from pimoroni. They have  a driver https://github.com/pimoroni/inky which works via the SPI and I2C interfaces on the Pi to update the screen.

Is there a way to extract an image that is to be rendered from the Kivy App instance or similar function?

cheers
Peter

elli...@cox.net

unread,
Apr 17, 2024, 10:53:20 PMApr 17
to Kivy users support
There are 2 options that come to mind. 
  1. The widget method export_to_png(), you could apply this to the root widget to get the image. https://kivy.org/doc/stable/api-kivy.uix.widget.html#kivy.uix.widget.Widget.export_to_png 




From: kivy-...@googlegroups.com <kivy-...@googlegroups.com> on behalf of Peter Milani <peterm...@gmail.com>
Sent: Wednesday, April 17, 2024 6:48 PM
To: Kivy users support <kivy-...@googlegroups.com>
Subject: [kivy-users] Rendering Kivy Window as Image
 
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d124a215-d0cf-4f8c-83a1-098a48c216bcn%40googlegroups.com.

Peter Milani

unread,
Apr 30, 2024, 7:54:07 PMApr 30
to Kivy users support
Thanks! For some reason I didn't get this email (or it went to spam) and was going to come back and post about the Window.screenshot. But thanks for the widget method too!
Reply all
Reply to author
Forward
0 new messages