Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately it isn't possible, due to the manner in which the PIL obtains the dimensions of the display device. When it obtains the Device Context, it <em>does</em> obtain one for all attached monitors:</p> <pre><code>screen = CreateDC("DISPLAY", NULL, NULL, NULL); </code></pre> <p>(<strong>display.c</strong>, line 296, version 1.1.7)</p> <p>However, to get the display dimensions, it uses this code:</p> <pre><code>width = GetDeviceCaps(screen, HORZRES); height = GetDeviceCaps(screen, VERTRES); </code></pre> <p>(<strong>display.c</strong>, lines 299-300, version 1.1.7)</p> <p>Which only returns the dimensions of the primary, active monitor. All subsequent operations are done with these width and height values, resulting in a final image that is only the size of the primary display.</p> <hr> <p>In order to receive a screengrab of all attached monitors, those two lines would need to be replaced with something like:</p> <pre><code>width = GetSystemMetrics(SM_CXVIRTUALSCREEN); height = GetSystemMetrics(SM_CYVIRTUALSCREEN); </code></pre> <p>After which you'd need to recompile PIL. This would provide you with the dimensions of the virtual screen, which is "... the bounding rectangle of all display monitors." [<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724385%28v=vs.85%29.aspx" rel="noreferrer">MSDN</a>] </p> <p>A more correct implementation would be using <a href="http://msdn.microsoft.com/en-us/library/dd162610%28v=vs.85%29.aspx" rel="noreferrer">EnumDisplayMonitors</a> to obtain device contexts for the individual monitors, along with altering ImageGrab.grab()'s interface (or adding a new function) to allow for the selection of a specific monitor, of whose device context would be used for the remaining operations.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload