最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php实现截屏功能代码
时间:2022-07-02 10:17:54 编辑:袖梨 来源:一聚教程网
PHP使用GD库实现截屏
PHP5.2.2以上版本的GD库实现了两个截屏函数 imagegrabscreen 和 imagegrabwindow
分别用于截取整个屏幕和截取某个窗口(同ALT+PrintScreen)的屏幕。
1. 截取整个屏幕 Screenshot
$im = imagegrabscreen();
imagepng($im, "myscreenshot.png");
?>
2. 截取一个窗口 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();
?>
3. 截取IE内容 Capture a window (IE for example) but with its content!
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.*21*a*ndy.com/blog/");
/* Still working? */
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
?>
4. 截取IE的全屏模式 IE in fullscreen mode
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Navigate("http://*www*.11*1cn.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");
?>
相关文章
- 搜狗手机输入法怎么调大小写字母 06-21
- breeno指令可以卸载吗 06-21
- 搜有红包怎么多得积分 06-21
- 华为nova11预计上市时间 06-21
- 云成绩如何注册账号 06-21
- UG10.0提示初始化错误 06-21