V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
billion
V2EX  ›  Python

Python 如何将 windows 剪贴板中的图片保存到电脑上?

  •  
  •   billion ·
    kingname · 2016-03-06 22:59:10 +08:00 · 3622 次点击
    这是一个创建于 2985 天前的主题,其中的信息可能已经有所发展或是发生改变。

    不使用包括 PIL 在内的第三方图形库的情况下,请问该如何做?

    我现在使用 win32clipboard 的 GetClipboardData(win32con.CF_DIB)可以得到一个图片的字符串,这个字符串应该就是图片的内容了。但是如果以.bmp 格式保存到硬盘上后,没有办法打开。

    3 条回复    2016-03-07 10:57:17 +08:00
    zhuangzhuang1988
        1
    zhuangzhuang1988  
       2016-03-07 09:34:52 +08:00
    bmp 不仅仅只是后缀名, 也是有格式的..
    billion
        2
    billion  
    OP
       2016-03-07 09:38:18 +08:00
    @zhuangzhuang1988 所以?
    zhuangzhuang1988
        3
    zhuangzhuang1988  
       2016-03-07 10:57:17 +08:00
    @billion 你要自己构建 bmp 的头才可能看得到..
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4939 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:05 · PVG 09:05 · LAX 18:05 · JFK 21:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.