ImageGrab.grab(bbox) is not grabbing the correct size. Am I using bbox correctly?

Viewed 959

I am trying to use ImageGrab to grab a certain portion of the screen but it is not grabbing the entire area set by bbox.

To make sure I am using bbox correctly I tried to simply capture the entire screen using the bbox parameter from the ImageGrab method.

I used both PyAutoGUI and Tkinter to verify the size of my display (both show my screen width as 1680 and my screen height as 1050) and then used those dimensions in the bbox parameter. However, when I do this, it only captures a small portion of the screen, as shown below:

enter image description here

When I use Image.grab() with no parameters, it captures the entire screen with no issues:

enter image description here

Here is my code:

import pyautogui
from PIL import ImageGrab, Image, ImageOps
import Tkinter as Tk

root = Tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()

print(screen_width)
print(screen_height)

print(pyautogui.size())

ImageGrab.grab().show()
ImageGrab.grab(bbox=(0, 0, screen_width, screen_height)).show()

Can you please explain how to use the bbox parameter if I am not using it correctly?

0 Answers
Related