用PHP截屏? [英] Screenshot with PHP ?

查看:189
本文介绍了用PHP截屏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以在PHP中制作窗口的屏幕截图?

我已经试过了:

Hey

Is it possible to make a screenshot of a window in PHP ?

I''ve tried this:

$img = imagegrabscreen();
imagepng($img, 'screenshot.png');


但这会创建一个黑色的.png文件!

这也会创建一个黑屏,但浏览器的顶部是可见的!


But it creates a black .png file !

This also creates a black screen but the top of the browser is visible !

$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.libgd.org");

/* Still working? */
while ($browser->Busy) {
    com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
imagedestroy($im);

推荐答案

img = imagegrabscreen(); imagepng(
img = imagegrabscreen(); imagepng(


img,' screenshot.png');


但这会创建一个黑色的.png文件!

这也会创建一个黑屏,但浏览器的顶部是可见的!


But it creates a black .png file !

This also creates a black screen but the top of the browser is visible !


浏览器 = COM(" );
browser = new COM("InternetExplorer.Application");


这篇关于用PHP截屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆