tags:

views:

1030

answers:

2
A: 

I have duplicated this error - WinXP SP3, Apache 2.2.11 running as a service, PHP 5.2.8, GD 2.0.34 bundled.

I allowed interaction with the desktop and restarted the service. On a dual-screen setup (Primary: 1440x900, Secondary: 1920x1200) I get a black rectangle the size of the primary screen. I have error reporting turned right up (E_ALL | E_STRICT) and XDebug does not report any errors.

Does anyone else care to take a shot at this? Most important variables seem to be OS (Win2000/WinXP/Win2003/Vista) and version of PHP (5.2.2/.3/.4/.5/.6/.8).

I am going to take a peek at the source to imagegrabscreen().

Hugh Bothwell
Thanks for that Hugh, I'm trying to get in touch with Pierre (who maintains the image extension) to see what he knows about this :)
Ross
+1  A: 

I looked at the source to imagegrabscreen();

at this point, I believe it is failing because we both have multi-monitor set-ups.

The current code calls GetDC(0), which according to http://msdn.microsoft.com/en-us/library/dd144871(VS.85).aspx should return the device context for "the entire screen", but "To get the DC for a specific display monitor, use the EnumDisplayMonitors and CreateDC functions"

I am going to do a bit more testing of this and see if I can come up with multi-monitor-friendly code.

Hugh Bothwell
That's great news Hugh. If you do make a patch for it could you contact Pierre (irc.freenode.org #libgd) to ask about including it? Thanks!
Ross