首页 诗词 名句 诗人 飞花令 诗单 诗词游戏 古籍 文学 成语 字典 词典 谜语 教育学习
查询

ImagickDraw::getStrokeWidth()函数—用法及示例

「 获取 ImagickDraw 对象的描边宽度 」


函数:ImagickDraw::getStrokeWidth()

适用版本:Imagick 2.0.0及以上版本

用法:getStrokeWidth() 方法用于获取 ImagickDraw 对象的描边宽度。

语法:float ImagickDraw::getStrokeWidth( void )

参数:无

返回值:返回一个浮点数,表示当前 ImagickDraw 对象的描边宽度。

示例:

// 创建一个 ImagickDraw 对象
$draw = new ImagickDraw();

// 设置描边宽度为2
$draw->setStrokeWidth(2);

// 获取当前描边宽度
$strokeWidth = $draw->getStrokeWidth();

echo "当前描边宽度为:{$strokeWidth}";

输出:

当前描边宽度为:2

注意:在使用该函数之前,需要确保已经安装了 Imagick 扩展,并且启用了 ImagickDraw 类。

热门PHP函数