Window
from slint import Windowpython
A window that renders the scene of a component on the screen.
To get the window of a component, use window.
Methods
Section titled “Methods”take_snapshot
Section titled “take_snapshot”take_snapshot() -> ImageTakes a snapshot of the window contents and returns it as an image. To get a snapshot in the size of your component, show the window first.
Raises RuntimeError if the backend or renderer can’t take snapshots,
or if the component of the window no longer exists.
Note: This function can be slow, because it re-renders the scene when needed.
Example of saving a screenshot with Pillow:
import slintfrom PIL import Imageimport numpy as np
main_window = slint.loader.app.MainWindow()main_window.show()
snapshot = main_window.window.take_snapshot()Image.fromarray(np.asarray(snapshot)).save("screenshot.png")python
© 2026 SixtyFPS GmbH