title: Getting imagegrabscreen to work
body: <p>I'm trying to get <a href="http://php.net/imagegrabscreen" rel="nofollow noreferrer"><code>imagegrabscreen</code></a> (a GD function) to work with my Apache/Vista PC.</p>
  
  <p>I'm using the following code:</p>
  
  <pre><code>&lt;?php
  $im = imagegrabscreen();
  
  header('Content-type: image/png');
  imagepng($im);
  imagedestroy($im);
  ?&gt;
  </code></pre>
  
  <p>At the moment I get a solid black image, the size of my secondary monitor (1024*768). I'm using Apache 2.2, runing as a service, Vista SP1 with UAC off, PHP 5.2.8 and GD (information below). I've followed the note on the <code>imagegrabscreen</code> page about allowing Apache access to the desktop. I've also restarted the service and the apache server. I get the same results with <code>imagegrabwindow</code>.</p>
  
  <p>Is this a bug (do other people have trouble running this method?) or is there something I'm doing wrong?</p>
  
  <pre><code>Array
  (
      [GD Version] =&gt; bundled (2.0.34 compatible)
      [FreeType Support] =&gt; 1
      [FreeType Linkage] =&gt; with freetype
      [T1Lib Support] =&gt; 1
      [GIF Read Support] =&gt; 1
      [GIF Create Support] =&gt; 1
      [JPG Support] =&gt; 1
      [PNG Support] =&gt; 1
      [WBMP Support] =&gt; 1
      [XPM Support] =&gt; 
      [XBM Support] =&gt; 1
      [JIS-mapped Japanese Font Support] =&gt; 
  )
  </code></pre>
  
  <p><strong>Apache Service Log On details:</strong></p>
  
  <p><a href="http://www.kalleload.net/uploads/maogfnfnczfh.png" rel="nofollow noreferrer">http://www.kalleload.net/uploads/maogfnfnczfh.png http://www.kalleload.net/uploads/maogfnfnczfh.png</a></p>