imagegrabwindow捕获黑屏

时间:2015-12-14 14:25:10

标签: php apache windows-services

此问题非常常见,解决方案是允许Apache interact with desktop。所以我允许它

here

并重新启动Apache service并仍然捕获黑屏

这是代码

<?php
set_time_limit(0);
$Browser = new COM('InternetExplorer.Application');
$Browserhandle = $Browser->HWND;
$Browser->Visible = true;
$Browser->Fullscreen = true;
$Browser->Navigate('http://www.stackoverflow.com');

while($Browser->Busy){
  com_message_pump(4000);
}

$img = imagegrabwindow($Browserhandle, 0);
$Browser->Quit();
imagepng($img, 'screenshot.png');
?>

我在Windows 10 Pro build 10586 Xampp 3.2.1 PHP 5.6.8

0 个答案:

没有答案