I was trying to capture my screen image using PIL.ImageGrab.grab().
Here is my problem -- When I use the code below, img
is only the upper left part of my screen.
from PIL import ImageGrab
img = ImageGrab.grab()
Use win32api.GetSystemMetrics()
to find out my screen size.
> GetSystemMetrics(0)
Out[6]: 1280
> GetSystemMetrics(1)
Out[7]: 720
I then used ImageGrab.grab((0,0,1280,720))
, and still got the upper left part of my screen! Desperately, I called ImageGrab.grab((0,0,1400,900))
, and the output is the same partial image with a black frame in its lower right area...
I have no idea what happened. It seems other guys are able to capture their screen by simply call ImageGrab.grab()
.
Any help would be appreciated!