0

我正在尝试使用 autopy 在我的屏幕上拍摄一小部分的图像,但由于某种原因我遇到了错误。作为参考,我在 1920x1080 显示器上运行。这是代码:

box = ((995, 5), (995 + 212, 5 + 72))
autopy.bitmap.capture_screen(box)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ValueError: The Image's dimensions are either too small or too large

谁能告诉我我做错了什么?

4

1 回答 1

1

功能

autopy.bitmap.capture_screen

在第一个元组中取左上角,然后在下一个元组中取宽度和高度。因此,要解决您的问题,只需使用

box = ((995, 5), (212, 72))
autopy.bitmap.capture_screen(box)
于 2019-12-07T04:57:04.613 回答