1. Capture the entire screen screenshot
Copy CodeThe code is as follows:
$im = Imagegrabscreen ();
Imagepng ($im, "myscreenshot.png");
?>
2. Capturing a window capture a Windows (IE for example)
Copy CodeThe code is as follows:
$browser = new COM ("Internetexplorer.application");
$handle = $browser->hwnd;
$browser->visible = true;
$im = Imagegrabwindow ($handle);
$browser->quit ();
Imagepng ($im, "iesnap.png");
$im = Imagegrabscreen ();
?>
3. Capturing IE content capture a window(IE for example) but with its content!
Copy CodeThe code is as follows:
$browser = new COM ("Internetexplorer.application");
$handle = $browser->hwnd;
$browser->visible = true;
$browser->navigate ("http://www.jb51.net");
/* Still working? */
while ($browser->busy) {
Com_message_pump (4000);
}
$im = Imagegrabwindow ($handle, 0);
$browser->quit ();
Imagepng ($im, "iesnap.png");
?>
4. Capturing IE's full-screen modeIE in fullscreen mode
Copy CodeThe code is as follows:
$browser = new COM ("Internetexplorer.application");
$handle = $browser->hwnd;
$browser->visible = true;
$browser->fullscreen = true;
$browser->navigate ("http://www.jb51.net");
/* Is it completely loaded? (Be aware of frames!) */
while ($browser->busy) {
Com_message_pump (4000);
}
$im = Imagegrabwindow ($handle, 0);
$browser->quit ();
Imagepng ($im, "iesnap.png");
?>
Above that is how to use the PHP com call IE window to open the Web page to screen, but many friends get the result is only a pure black picture, this is why?
There may be two cases, the first case is that this COM component only applies to Windows Server, the other system server is not supported, because he does not have Internet Explorer, the second case is not open allow services to interact with the desktop! The second is the most common, and the way to open it is to click on the computer (My Computer), right----services and applications----Apache (I use Apache server myself)--right--property-&G T Login, login status below both!
http://www.bkjia.com/PHPjc/825074.html www.bkjia.com true http://www.bkjia.com/PHPjc/825074.html techarticle 1. Capture the entire screen screenshot copy code code as follows: PHP $im = Imagegrabscreen (); Imagepng ($im, "myscreenshot.png"); 2. Capturing a window capture a Windows (IE for ex ...