jaraco / jaraco.clipboard

MIT License
21 stars 1 forks source link

How to get images? #1

Closed GuiRitter closed 6 years ago

GuiRitter commented 6 years ago

Hi there.

How do I use copy_image() to get images from the clipboard?

I found no documentation anywhere.

Thanks in advance.

jaraco commented 6 years ago

How do I use copy_image() to get images from the clipboard?

You use paste_image to get images from the clipboard.

The docs are currently relegated to the readme and the code. I welcome improvements to the docs.

Presuming you're working on Windows, the only platform currently supporting images, I notice that even there, the 'copy' function is not present, so I'd expect a NotImplementedError to be raised if you were to invoke jaraco.clipboard.copy_image... but I would expect jaraco.clipboard.paste_image() to return something, as it's based on this.

See here for an example that uses paste_image to retrieve an image to jpeg using pillow.

GuiRitter commented 6 years ago

Thank you! I finally managed to get this part working. Although the readme has basically no information about images, that example did the trick.