本文整理汇总了PHP中COM::Navigate方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::Navigate方法的具体用法?PHP COM::Navigate怎么用?PHP COM::Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COM
的用法示例。
在下文中一共展示了COM::Navigate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputImage
private function outputImage($domain)
{
var_dump('start:' . memory_get_usage());
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$url = "http://www." . $domain;
$file = "../metadata/screen/3000/" . $domain . ".png";
echo $url . "\n";
$browser->Navigate($url);
while ($browser->Busy) {
com_message_pump(1000);
}
if (!file_exists($file)) {
$im = imagegrabwindow($handle, 0);
imagepng($im, $file);
imagedestroy($im);
}
$fp = fopen($file, 'rb');
fpassthru($fp);
$browser->Quit();
var_dump('free:' . memory_get_usage());
}
示例2: get_url_pic2
protected function get_url_pic2($url, $file, $scroll = 420)
{
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Width = 2900;
$browser->Height = 9780;
$browser->Left = 2780;
$browser->Top = 2780;
$browser->menubar = 0;
$browser->AddressBar = 0;
$browser->StatusBar = 0;
$browser->Navigate($url);
$browser->ToolBar = 0;
/* Still working? */
while ($browser->Busy) {
com_message_pump(4000);
}
$browser->document->parentWindow->scrollTo(0, $scroll);
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, ROOT . $file);
imagedestroy($im);
}
示例3: COM
<?php
/**
*
* @authors Your Name (you@example.org)
* @date 2015-07-30 13:48:06
* @version $Id$
*/
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Navigate("http://www.okbase.net");
/* 仍旧在运行? */
while ($browser->Busy) {
com_message_pump(4000);
}
/* 抓屏 */
$im = imagegrabwindow($handle, 0);
$browser->Quit();
/* 保存为png */
imagepng($im, "okbase.png");
示例4: COM
<?php
set_time_limit(120);
$i = 1;
do {
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->StatusBar = false;
$browser->Fullscreen = true;
$browser->Visible = true;
$browser->Navigate("http://192.168.1.9/anime/image.php?crop=" . $i);
while ($browser->Busy) {
com_message_pump(20000);
}
$im = imagegrabwindow($handle);
$browser->Quit();
$filename = "tmp_" . $i . ".png";
imagepng($im, $filename);
list($width, $height) = getimagesize($filename);
$new_width = $width - 176;
if ($i == 1) {
$new_height = $height;
} else {
$new_height = $height - 436;
}
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefrompng($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);
imagepng($image_p, $filename);
imagedestroy($im);
if (filesize($filename) > 102400) {