mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
rename parameter, add note to docs
This commit is contained in:
parent
19426417ff
commit
6a2d8f8da0
|
@ -11,7 +11,7 @@ try:
|
|||
for im in [
|
||||
ImageGrab.grab(),
|
||||
ImageGrab.grab(include_layered_windows=True),
|
||||
ImageGrab.grab(multimonitor=True),
|
||||
ImageGrab.grab(all_screens=True),
|
||||
]:
|
||||
self.assert_image(im, im.mode, im.size)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ or the clipboard to a PIL image memory.
|
|||
|
||||
.. versionadded:: 1.1.3
|
||||
|
||||
.. py:function:: PIL.ImageGrab.grab(bbox=None, include_layered_windows=False, multimonitor=False)
|
||||
.. py:function:: PIL.ImageGrab.grab(bbox=None, include_layered_windows=False, all_screens=False)
|
||||
|
||||
Take a snapshot of the screen. The pixels inside the bounding box are
|
||||
returned as an "RGB" image on Windows or "RGBA" on macOS.
|
||||
|
@ -20,8 +20,9 @@ or the clipboard to a PIL image memory.
|
|||
.. versionadded:: 1.1.3 (Windows), 3.0.0 (macOS)
|
||||
|
||||
:param bbox: What region to copy. Default is the entire screen.
|
||||
Note that on Windows OS, the top-left point may be negative if ``all_screens=True`` is used.
|
||||
:param include_layered_windows: Includes layered windows. Windows OS only.
|
||||
:param multimonitor: Capture all monitors. Windows OS only.
|
||||
:param all_screens: Capture all monitors. Windows OS only.
|
||||
:return: An image
|
||||
|
||||
.. py:function:: PIL.ImageGrab.grabclipboard()
|
||||
|
|
|
@ -29,7 +29,7 @@ else:
|
|||
raise ImportError("ImageGrab is macOS and Windows only")
|
||||
|
||||
|
||||
def grab(bbox=None, include_layered_windows=False, multimonitor=False):
|
||||
def grab(bbox=None, include_layered_windows=False, all_screens=False):
|
||||
if sys.platform == "darwin":
|
||||
fh, filepath = tempfile.mkstemp(".png")
|
||||
os.close(fh)
|
||||
|
@ -40,7 +40,7 @@ def grab(bbox=None, include_layered_windows=False, multimonitor=False):
|
|||
if bbox:
|
||||
im = im.crop(bbox)
|
||||
else:
|
||||
offset, size, data = grabber(include_layered_windows, multimonitor)
|
||||
offset, size, data = grabber(include_layered_windows, all_screens)
|
||||
im = Image.frombytes(
|
||||
"RGB",
|
||||
size,
|
||||
|
|
|
@ -323,14 +323,14 @@ PyObject*
|
|||
PyImaging_GrabScreenWin32(PyObject* self, PyObject* args)
|
||||
{
|
||||
int x = 0, y = 0, width, height;
|
||||
int includeLayeredWindows = 0, multimonitor = 0;
|
||||
int includeLayeredWindows = 0, all_screens = 0;
|
||||
HBITMAP bitmap;
|
||||
BITMAPCOREHEADER core;
|
||||
HDC screen, screen_copy;
|
||||
DWORD rop;
|
||||
PyObject* buffer;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|ii", &includeLayeredWindows, &multimonitor))
|
||||
if (!PyArg_ParseTuple(args, "|ii", &includeLayeredWindows, &all_screens))
|
||||
return NULL;
|
||||
|
||||
/* step 1: create a memory DC large enough to hold the
|
||||
|
@ -339,7 +339,7 @@ PyImaging_GrabScreenWin32(PyObject* self, PyObject* args)
|
|||
screen = CreateDC("DISPLAY", NULL, NULL, NULL);
|
||||
screen_copy = CreateCompatibleDC(screen);
|
||||
|
||||
if (multimonitor) {
|
||||
if (all_screens) {
|
||||
x = GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||
y = GetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||
width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
|
|
Loading…
Reference in New Issue
Block a user