全部博文(315)
分类:
2008-05-06 05:47:37
//全屏 Screenshot
$im = imagegrabscreen();
imagejpeg($im, "myscreenshot.jpg");
//窗口 Capture a window (IE for example)
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$im = imagegrabwindow($handle);
$browser->Quit();
imagepng($im, "iesnap.png");
$im = imagegrabscreen();
// 窗口和其内容 Capture a window (IE for example) but with its content!
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://blog.rjsuzhou.com");
// Still working?
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
//全屏IE in fullscreen mode
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Navigate("");
// 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");
?>