Copy image to clipboard?

后端 未结 4 617
既然无缘
既然无缘 2020-12-10 06:19

First of all, the question on SO copy image to clipboard in python leads to answer Write image to Windows clipboard in python with PIL and win32clipboard?, which was only go

4条回答
  •  醉话见心
    2020-12-10 07:02

    You don't want StringIO here. Images are raw binary data, and in Py3, str is purely for text, bytes and bytes-like objects (bytearray, contiguous memoryviews, mmaps) are for binary data. To replace Py2's StringIO.StringIO for binary data, you want to use io.BytesIO in Python 3, not io.StringIO.

提交回复
热议问题