Heim  >  Artikel  >  Backend-Entwicklung  >  PHP截取IE浏览器并缩小原图的方法,php截取ie原图_PHP教程

PHP截取IE浏览器并缩小原图的方法,php截取ie原图_PHP教程

WBOY
WBOYOriginal
2016-07-12 08:57:58757Durchsuche

PHP截取IE浏览器并缩小原图的方法,php截取ie原图

本文实例讲述了PHP截取IE浏览器并缩小原图的方法。分享给大家供大家参考,具体如下:

// 截取一个窗口 Capture a window (IE for example)
$ie = new COM("InternetExplorer.Application");
$ie->Navigate2($webaddress);
$oWSH = new COM("WScript.Shell");
while ($ie->ReadyState!=4) usleep(10000);
  $handle = $ie->HWND;
  $ie->Visible = true;
while ($ie->Busy) {
  com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$ie->Quit();
$file="public/images/".time()."iesnap.png";
imagepng($im,$file);
//--------------------
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Navigate($webaddress);
while ($browser->Busy) {
  com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
//opendir("public/images/");
$new_img=imagecreatetruecolor("206","132");
$file="public/images/".time()."ie.png";
imagecopyresampled($new_img,$im,0,0,206,132,206,142,1024,768);
imagepng($new_img ,$file);
imagedestroy($new_img);

如果有问题可以选择桌面与程序交互

更多关于PHP相关内容感兴趣的读者可查看本站专题:《php日期与时间用法总结》、《php面向对象程序设计入门教程》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家PHP程序设计有所帮助。

您可能感兴趣的文章:

  • PHP截取指定图片大小的方法
  • PHP imagegrabscreen和imagegrabwindow(截取网站缩略图)的实例代码
  • php实现粘贴截图并完成上传功能
  • php 获取SWF动画截图示例代码
  • THINKPHP+JS实现缩放图片式截图的实现
  • PHP利用imagick生成组合缩略图
  • php等比例缩放图片及剪切图片代码分享
  • PHP实现原比例生成缩略图的方法

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1106119.htmlTechArticlePHP截取IE浏览器并缩小原图的方法,php截取ie原图 本文实例讲述了PHP截取IE浏览器并缩小原图的方法。分享给大家供大家参考,具体如下:...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn