解决方案 »
- 新手半夜求解:Unknown column 'qq' in 'field list'怎么解决
- 求救,请问一个调用远程url的问题!
- 二级联动传值的问题!!
- PHP 数据库搜索算法
- ...这个问题,还真不知道怎么问~~关于apache php
- 的用户密码提交之后的处理页怎么用IE的后退键返回不不过去呢
- 一个向数据庫中添加注册的短功能,
- 这个错误:UploadAction为什么是Undefined ,要在php.ini设置什么吗?
- 急求时间函数,我这边机器上没有php手册,查不到,请帮忙告知!谁先告知先得全分!
- onethink中 list_to_tree 函数 是如何返回数组的
- 关于分表的一些疑问
- set_error_handler()这个函数输出 PHP错误到指定的数据库里数据表的字段里面
$url = 'http://avatar.csdn.net/9/4/5/1_kenshako.jpg';
$im = imagecreatefromjpeg($url);
imagemask($im, 10, 20, 60, 40, 8);
imagepng($im);
imagedestroy($im);/**
马赛克:void imagemask ( resource image, int x1, int y1, int x2, int y2, int deep)
imagemask() 把坐标 x1,y1 到 x2,y2(图像左上角为 0, 0)的矩形区域加上马赛克。
deep为模糊程度,数字越大越模糊。
**/
/**
* GD image mask
*
* @edit www.jbxue.com
*/
function imagemask($im, $x1, $y1, $w, $h, $deep) {
$x2 = min(imagesx($im), $x1 + $w);
$y2 = min(imagesy($im), $y1 + $h);
for($x = $x1; $x < $x2; $x += $deep) {
for ($y = $y1; $y < $y2; $y += $deep) {
$color = ImageColorAt ($im, $x + round($deep / 2), $y + round($deep / 2));
imagefilledrectangle ($im, $x, $y, $x + $deep, $y + $deep, $color);
}
}
}
{
for($x = $x1; $x < $x2; $x += $deep)
{
for ($y = $y1; $y < $y2; $y += $deep)
{
$color = ImageColorAt ($im, $x + round($deep / 2), $y + round($deep / 2));
imagefilledrectangle ($im, $x, $y, $x + $deep, $y + $deep, $color);
}
}
}header("Content-type: image/png");
$im = imagecreatefromjpeg("http://avatar.csdn.net/B/D/B/1_fdipzone.jpg");
imagemask($im, 57, 60, 103, 80, 8);
imagepng($im);
imagedestroy($im);
4# 5# 都GOOD