PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I tried to run the code, but I got the following error info:
Warning: imagegrabwindow() [function.imagegrabwindow]: gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully in D:\Program Files\Easy2PHP5\WebSite\test2.php on line 10
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Unknown<br/><b>Description:</b> Unknown' in D:\Program Files\Easy2PHP5\WebSite\test2.php:11 Stack trace: #0 D:\Program Files\Easy2PHP5\WebSite\test2.php(11): com->Quit() #1 {main} thrown in D:\Program Files\Easy2PHP5\WebSite\test2.php on line 11
Looks like the imagegrabwindow() function is broken. It's only very experimental code, and it does tend to be very dependent on the specific build of PHP. I've never managed to get it working... I suggest you install a newer version of PHP, or build it yourself from the source of a version where that function is definitely working.
I check the function "imagegrabwindow" in php manual, it tells me that imagegrabwindow() requires php5.2.2 + , and my php version is php5.2.5, function_exists("imagegrabwindow") returns true. but the code didn't work. Then I download php5.2.6, function_exists("imagegrabwindow") returns true, but still doesn't the code work and causes the same the error.
Is it said that imagegrabwindow() is not stable ? In this case how can I capture a web page sreen with php ?