- 论坛徽章:
- 0
|
人家的地方,怎么都不沾光。
方法是很多的imagegrabwindow 函数就可以的。我这用的是一个网站提供的服务。
<?php
// @filename imgpot.php
// @version 0.0.3
// @author shitou
// @contact shitou254@126.com
// @update 2008-6-9
// @comment PHP template for Editplus4PHP
$_GET['url'] = trim($_GET['url']);
if(empty($_GET['url'])) {
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="php,perl,python,c#,c++,qq">
<title>生成网站截图</title>
</head>
<h3>生成网站截图</h3>
<form action="imgpot.php" method="get" >
<input type="text" name="url" value="http://www.baidu.com" size="40" />
<input type="submit" value="获取图像" />
</form>
<!--这是广告去了-->
<img src="http://api.webs08.net/imgpot.php?url=http://www.baidu.com" />
<?php
} else {
header("Content-type: image/png");
$imggeturl = 'http://mozshot.nemui.org/shot/large?';
if(preg_match("/^http:\/\//", $_GET['url'])) {
$imggeturl .= $_GET['url'];
} else {
$imggeturl .= 'http://'.$_GET['url'];
}
$imgstr = file_get_contents($imggeturl);
echo $imgstr;
$r = imagecreatefromstring($imgstr);
imagepng($r);
imagedestroy($r);
} |
|
|