How do I read a jpg or png from the windows clipboard in python and vice versa?

后端 未结 4 373
慢半拍i
慢半拍i 2020-12-08 03:25

I have an image (jpg, png, etc.) in the windows clipboard. I\'d like to save it to a file. win32clipboard would seem to be the answer, but every example I can find deals wi

4条回答
  •  自闭症患者
    2020-12-08 03:38

    Using PythonMagick (binaries):

    from PythonMagick import Image
    Image("clipboard:").write("PNG32:clipboard.png")  # clipboard -> file
    Image("clipboard.png").write("clipboard:")  # file -> clipboard
    

提交回复
热议问题