php怎么生成圆角图片(一)

您好,欢迎来到百闽人生网登录 注册

百闽首页 | 考试日历 | 百闽娱乐 | 书信频道 | 节日庆典 | 语录句子 | 免费发布培训课程

百闽人生网

百闽人生网 > 培训新闻 > 电脑/IT > php怎么生成圆角图片(一)

php怎么生成圆角图片(一)

具体如下:

代码如下:

$image_file = $_GET["src"];

$corner_radius = isset($_GET["radius"]) ? $_GET["radius"] : 20; // The default corner radius is set to 20px

$topleft = (isset($_GET["topleft"]) and $_GET["topleft"] == "no") ? false : true; // Top-left rounded corner is shown by default

$bottomleft = (isset($_GET["bottomleft"]) and $_GET["bottomleft"] == "no") ? false : true; // Bottom-left rounded corner is shown by default

$bottomright = (isset($_GET["bottomright"]) and $_GET["bottomright"] == "no") ? false : true; // Bottom-right rounded corner is shown by default

$topright = (isset($_GET["topright"]) and $_GET["topright"] == "no") ? false : true; // Top-right rounded corner is shown by default

$imagetype=strtolower($_GET["imagetype"]);

$backcolor=$_GET["backcolor"];

$endsize=$corner_radius;

$startsize=$endsize*3-1;

$arcsize=$startsize*2+1;

if (($imagetype=="jpeg") or ($imagetype=="jpg")) {

$image = imagecreatefromjpeg($image_file);

} else {

if (($imagetype=="GIF") or ($imagetype=="gif")) {

$image = imagecreatefromgif($image_file);

} else {

$image = imagecreatefrompng($image_file);

}

}

首页 1 2 3 4 下页 

关于我们 | 招生合作 | 负责声明 | 常见问题 | 诚聘英才 | 联系我们

Copyright©2014 www.bminlife.com 百闽人生网 版权所有©百闽人生网 闽ICP备14001301号
本文标题:php怎么生成圆角图片
分站加盟及广告服务QQ:1476191318
友情提示:本站所有信息均由本站注册会员免费发布,如涉及版权问题或虚假信息请及时与本站联系。——我们一直在追求真实!