GmagickDraw::getstrokewidth()
获取当前绘制对象的线条宽度
函数名称:GmagickDraw::getstrokewidth()
适用版本:Gmagick 1.1.0
函数描述:获取当前绘制对象的线条宽度。
用法:
public GmagickDraw::getstrokewidth ( void ) : float
参数:
该函数不接受任何参数。
返回值:
返回一个浮点数,表示当前绘制对象的线条宽度。
示例:
// 创建一个新的绘制对象
$draw = new GmagickDraw();
// 设置线条宽度为2.5
$draw->setstrokewidth(2.5);
// 获取当前线条宽度
$strokeWidth = $draw->getstrokewidth();
echo "当前线条宽度为:" . $strokeWidth;
输出结果:
当前线条宽度为:2.5
注意事项:
该函数需要 Gmagick 扩展支持,确保已经正确安装并启用了 Gmagick 扩展。
在调用该函数之前,应先创建一个 GmagickDraw 对象,并通过 setstrokewidth() 方法设置线条宽度。
线条宽度可以是一个浮点数,表示以像素为单位的线条粗细。
如果未设置线条宽度,则默认为1.0。