imagesetthickness
(PHP 4 >= 4.0.6, PHP 5, PHP 7)
imagesetthickness - 设置线条绘制的粗细
描述
bool imagesetthickness ( resource $image , int $thickness )
imagesetthickness()设置绘制矩形,多边形,弧形等thickness
像素时绘制的线条的粗细。
参数
`image`
一个图像资源,由图像创建函数之一返回,如imagecreatetruecolor()。
thickness
Thickness, in pixels.
返回值
成功返回TRUE或失败时返回FALSE。
例子
示例#1 imagesetthickness()示例
<?php
//?Create?a?200x100?image
$im?=?imagecreatetruecolor(200,?100);
$white?=?imagecolorallocate($im,?0xFF,?0xFF,?0xFF);
$black?=?imagecolorallocate($im,?0x00,?0x00,?0x00);
//?Set?the?background?to?be?white
imagefilledrectangle($im,?0,?0,?299,?99,?$white);
//?Set?the?line?thickness?to?5
imagesetthickness($im,?5);
//?Draw?the?rectangle
imagerectangle($im,?14,?14,?185,?85,?$black);
//?Output?image?to?the?browser
header('Content-Type:?image/png');
imagepng($im);
imagedestroy($im);
?>
上面的例子会输出类似于:
← imagesetstyle
imagesettile →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com