函式: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 類。