1

I'm trying

$im = imagegrabscreen();
imagepng($im, "1myscreenshot.png");
imagedestroy($im);

But I just get a black image

Can you please help me ? Im using : Windows 7 , XAMPP 1.7.4 (PHP: 5.3.5)

thanks jokonardi

Manse
  • 37,765
  • 10
  • 83
  • 108
Joko Nardi
  • 21
  • 1
  • 2
  • 10
  • Check this: http://stackoverflow.com/questions/631449/getting-imagegrabscreen-to-work – Sudhir Bastakoti Nov 24 '11 at 09:21
  • im not understand that ...can you give me more detail please ..thanks before manseUk 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. – Joko Nardi Nov 24 '11 at 11:22

1 Answers1

0

Is your Apache set to 'Allow service to interact with desktop'? If not this function will not work.

Peter-W
  • 737
  • 2
  • 9
  • 14
  • 1
    http://stackoverflow.com/questions/631449/getting-imagegrabscreen-to-work -> im try this but still not working – Joko Nardi Nov 24 '11 at 09:25