【问题标题】:Get screenshot of hidden window Python Mac OS获取隐藏窗口 Python Mac OS 的截图
【发布时间】:2022-07-09 09:26:22
【问题描述】:

我正在尝试使用 python 截取 Mac OS 上的背景窗口。 我目前只能获取可见屏幕的屏幕截图。

x1,y1,width,height =pygetwindow.getWindowGeometry('Google Chrome ')
x2=x1+width
y2=y1+height

im = pyautogui.screenshot(path)
im =im.crop((x1,y1,x2,y2))
im.save(path)
im.show()

【问题讨论】:

    标签: python macos


    【解决方案1】:

    我无法发表评论,但我也在研究这个论点。不幸的是,我的 MacBook 的 macOS 版本被锁定到 11,但如果你有 12 或更好的 10.13 [beta],你可以尝试使用这个新库:https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos

    如果你能更新我们的消息!

    【讨论】:

      猜你喜欢
      • 2011-07-04
      • 1970-01-01
      • 1970-01-01
      • 2020-04-22
      • 1970-01-01
      • 1970-01-01
      • 2016-02-20
      • 2012-03-16
      • 1970-01-01
      相关资源
      最近更新 更多