首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

imagesetthickness

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

imagesetthickness - 设置线条绘制的粗细

描述

代码语言:javascript
复制
bool imagesetthickness ( resource $image , int $thickness )

imagesetthickness()设置绘制矩形,多边形,弧形等thickness像素时绘制的线条的粗细。

参数

代码语言:txt
复制
`image`   

一个图像资源,由图像创建函数之一返回,如imagecreatetruecolor()。

thickness

Thickness, in pixels.

返回值

成功返回TRUE或失败时返回FALSE。

例子

示例#1 imagesetthickness()示例

代码语言:javascript
复制
<?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 →

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com