Skip to content

Commit c468e17

Browse files
authored
Merge pull request #43 from botcity-dev/fix/screen-cut-region-parameters
FIX: Adjusting region parameter in screenshot method
2 parents 2588aba + b0c2e3f commit c468e17

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

botcity/core/bot.py

+6
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ def screenshot(self, filepath=None, region=None):
508508
Returns:
509509
Image: The screenshot Image object
510510
"""
511+
if region:
512+
x, y, width, height = region
513+
width = x + width
514+
height = y + height
515+
region = (x, y, width, height)
516+
511517
img = ImageGrab.grab(bbox=region)
512518
if filepath:
513519
img.save(filepath)

0 commit comments

Comments
 (0)