How to copy an image using win32clipboard

Steven Manross <[email protected]>
Newsgroups gmane.comp.python.windows
Message-ID <[email protected]>
Based on reading http://timgolden.me.uk/pywin32-docs/win32clipboard__GetClipboardData_meth.html I would suggest that getting image data from the clipboard isn't implemented yet, but I do not know that for sure as I don't know when that document was updated.

However, this python code seems to get text data just fine.

import win32clipboard


win32clipboard.OpenClipboard()
var = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()

print(var)

I would also point out that it seems that the "CloseClipboard" is incredibly important as it seems that python takes an exclusive lock on the clipboard while the Clipboard is Opened.

HTH

Steven
---------------
Date: Tue, 1 Dec 2020 11:00:52 +0000
From: Pranav Gadre <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [python-win32] How to copy an image using win32clipboard
Message-ID:
	<SG2PR01MB3400FB3B4A7AD19C1F7D21789DF40@SG2PR01MB3400.apcprd01.prod.exchangelabs.com>
	
Content-Type: text/plain; charset="windows-1252"

Hello,

When we take a snip on windows OS, it automatically goes to clipboard. I want to access any copied image using win32clipboard. How do I do that?
Please check this for more reference: Closed issue<https://github.com/mhammond/pywin32/issues/1627>
Thank you and pardon me for any missing things as I?m new to this mailing list.
Regards,
Pranav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.