您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP imagesetthickness有什么用

2025/11/5 21:56:27发布29次查看
php imagesetthickness用于设定画线的宽度,可以把画矩形,多边形,椭圆等等时所用的线宽设为指定像素大小;语法“imagesetthickness(image,thickness)”,thickness用于指定线宽(像素)。
php imagesetthickness有什么用?
php imagesetthickness 用法
(php 4 >= 4.0.6, php 5, php 7)
imagesetthickness — 设定画线的宽度
说明
imagesetthickness ( resource $image , int $thickness ) : bool
imagesetthickness() 把画矩形,多边形,椭圆等等时所用的线宽设为 thickness 个像素。成功时返回 true, 或者在失败时返回 false。
note: 此函数需要 gd 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。
参数
image
由图象创建函数(例如imagecreatetruecolor())返回的图象资源。
thickness
thickness, in pixels.
返回值
成功时返回 true, 或者在失败时返回 false。
范例
example #1 imagesetthickness() example
<?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 whiteimagefilledrectangle($im, 0, 0, 299, 99, $white);// set the line thickness to 5imagesetthickness($im, 5);// draw the rectangleimagerectangle($im, 14, 14, 185, 85, $black);// output image to the browserheader('content-type: image/png');imagepng($im);imagedestroy($im);?>
以上例程的输出类似于:
更多相关技术文章,请访问!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product