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 <pranav.ga...@outlook.com>
To: "python-win32@python.org" <python-win32@python.org>
Subject: [python-win32] How to copy an image using win32clipboard
Message-ID:
        
<sg2pr01mb3400fb3b4a7ad19c1f7d21789d...@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



_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to