1. 截取整个屏幕 Screenshot
复制代码 代码如下:
$im = imagegrabscreen();
imagepng($im, “myscreenshot.png”);
?>
复制代码 代码如下:
$browser = new COM(“InternetExplorer.Application”);
$handle = $browser->HWND;
$browser->Visible = true;
$im = imagegrabwindow($handle);
$browser->Quit();
imagepng($im, “iesnap.png”);
$im = imagegrabscreen();
?>
复制代码 代码如下:
$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”);
?>
复制代码 代码如下:
$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”);
?>