为在PHP中创建的图像赋予边框
发布时间:2020-12-13 16:25:42 所属栏目:PHP教程 来源:网络整理
导读:如何为使用 PHP创建的图像赋予边框? function drawBorder($img,$color,$thickness = 1) { $x1 = 0; $y1 = 0; $x2 = ImageSX($img) - 1; $y2 = ImageSY($img) - 1; for($i = 0; $i $thickness; $i++) { ImageRectangle($img,$x1++,$y1++,$x2--,$y2--,$color)
如何为使用
PHP创建的图像赋予边框?
function drawBorder(&$img,&$color,$thickness = 1) { $x1 = 0; $y1 = 0; $x2 = ImageSX($img) - 1; $y2 = ImageSY($img) - 1; for($i = 0; $i < $thickness; $i++) { ImageRectangle($img,$x1++,$y1++,$x2--,$y2--,$color); } } 然后用法只是做. $color = imagecolorallocate($img,255,0); drawBorder($img,$color,255); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |