【问题标题】:Is there a way to load a pyautogui screenshot into a PIL image?有没有办法将 pyautogui 屏幕截图加载到 PIL 图像中?
【发布时间】:2021-04-14 13:26:14
【问题描述】:

有没有办法将 pyautogui 屏幕截图加载到 PIL 中以供进一步使用?请看代码:

screenshot = pyautogui.screenshot()

pil_img = PIL.Image(???).load()

我已经搜索了这个问题的答案,但无济于事。谢谢。

【问题讨论】:

    标签: python python-imaging-library pyautogui


    【解决方案1】:

    pyautogui.screenshot() 函数会自动返回 PIL Image 对象,如果您不向它传递文件名参数,则按照 the documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-03
      • 2010-09-08
      • 1970-01-01
      • 1970-01-01
      • 2022-10-14
      • 2020-02-04
      • 1970-01-01
      相关资源
      最近更新 更多