您的位置:首页 > 编程语言 > PHP开发

PHP制作圆角图片

2016-07-13 14:57 603 查看
public function get_lt_rounder_corner($radius)
{
$img = imagecreatetruecolor($radius * 2, $radius * 2);  // 创建一个正方形的图像
$bgcolor = imagecolorallocate($img, 255, 255, 255);   // 图像的背景
$fgcolor = imagecolorallocate($img, 0, 0, 0);
imagefill($img, 0, 0, $bgcolor);

imagefilledarc($img, $radius, $radius, $radius * 2, $radius * 2, 180, 180, $fgcolor, IMG_ARC_PIE);
// 将弧角图片的颜色设置为透明
imagecolortransparent($img, $fgcolor);
// 变换角度
// $img = imagerotate($img, 90, 0);
// $img = imagerotate($img, 180, 0);
// $img = imagerotate($img, 270, 0);
// header('Content-Type: image/png');
// imagepng($img);
return $img;
}


4000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: