Copy Screenshot to Clipboard in Python

Ideally there would be an equivalent to SaveScreenshot in paraview.simple but I’m hoping there’s at least something already implemented even if not that… simple.

If not:
I can probably make a function using the existing SaveScreenshot along with the tempfile and win32clipboard libraries or something like that. I see that PIL/Pillow libraries are not included, any suggestions for an alternative to PIL.Image?

Oh, I ask because I want to save a layout to clipboard, not just a single view.
Probably should have started with that :slight_smile:

Internals were added to support “Copy Screenshot to Clipboard” in the UI. It should be doable to access it through pqSaveScreenshotReaction::copyScreenshotToClipboard().

Hmm, that looks like it’s from the C++ source code, right?

What I’m hoping for is a Python wrapping for that code.
I didn’t see anything in the paraview.simple documentation or source code.
I also couldn’t find anything that looked useful by poking around interactively with the existing paraview.simple API.