PHP imagesetthickness用于设定画线的宽度,可以把画矩形,多边形,椭圆等等时所用的线宽设为指定像素大小;语法“imagesetthickness(image,thickness)”,thickness用于指定线宽(像素)。

PHP imagesetthickness有什么用?
PHP imagesetthickness 用法
(PHP 4 >= 4.0.6, PHP 5, PHP 7)
imagesetthickness — 设定画线的宽度
立即学习“PHP免费学习笔记(深入)”;
说明
imagesetthickness ( resource $image , int $thickness ) : bool
imagesetthickness() 把画矩形,多边形,椭圆等等时所用的线宽设为 thickness 个像素。成功时返回 TRUE, 或者在失败时返回 FALSE。
Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。
参数
image
由图象创建函数(例如imagecreatetruecolor())返回的图象资源。
jQuery老虎机转动抽奖程序,是不是很熟悉,这个不是在娱乐场所可以玩到的么,我们在网页当中也可以玩了,现在有很多的娱乐网站就是用的这样的效果,php中文网推荐下载!
153
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 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);
?>以上例程的输出类似于:

更多相关技术文章,请访问PHP中文网!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号