# Copy Screenshot to Clipboard in Python

**URL:** https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430
**Category:** ParaView Support
**Tags:** python
**Created:** [February 9, 2021, 9:46pm UTC](https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430 "2021-02-09T21:46:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [February 9, 2021, 9:46pm UTC](https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430/1 "2021-02-09T21:46:42Z")

</div>

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`?

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [February 9, 2021, 9:48pm UTC](https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430/2 "2021-02-09T21:48:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.paraview.org/user_avatar/discourse.paraview.org/joachim_p/32/9596_2.png) [@Joachim\_P](https://discourse.paraview.org/u/Joachim_P)
#### Post date: [February 11, 2021, 10:05pm UTC](https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430/3 "2021-02-11T22:05:33Z")

</div>

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

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [February 11, 2021, 11:54pm UTC](https://discourse.paraview.org/t/copy-screenshot-to-clipboard-in-python/6430/4 "2021-02-11T23:54:37Z")

</div>

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.
