ImagickDraw::getStrokeOpacity() 函數是 PHP 中的一個內置函數,用於返回描邊對象輪廓的不透明度。
用法:
float ImagickDraw::getStrokeOpacity( void )
參數:該函數不接受任何參數。
返回值:此函數在成功時返回筆畫不透明度。
錯誤/異常:它會在出錯時拋出 ImagickException。
以下示例程序旨在說明 PHP 中的 ImagickDraw::getStrokeOpacity() 函數:
程序:
<?php
// Create an ImagickDraw object
$draw = new \ImagickDraw();
// Set the Stroke Color
$draw->setStrokeColor('Green');
// Set the Fill Color
$draw->setFillColor('Red');
// Set the stroke width
$draw->setStrokeWidth(7);
// Draw the rectangle
$draw->rectangle(40, 30, 200, 260);
// Set the stroke opacity
$draw->setStrokeOpacity(0.5);
// Display the StrokeOpacity
echo $draw->getStrokeOpacity();
?>
輸出:
0.49999237048905
參考: http://php.net/manual/en/imagickdraw.getstrokeopacity.php
相關用法
- PHP GmagickDraw getstrokeopacity()用法及代碼示例
- PHP ImagickDraw getTextAlignment()用法及代碼示例
- PHP ImagickDraw polygon()用法及代碼示例
- PHP ImagickDraw roundRectangle()用法及代碼示例
- PHP ImagickDraw arc()用法及代碼示例
- PHP ImagickDraw circle()用法及代碼示例
- PHP ImagickDraw bezier()用法及代碼示例
- PHP ImagickDraw rectangle()用法及代碼示例
- PHP ImagickDraw line()用法及代碼示例
- PHP ImagickDraw point()用法及代碼示例
- PHP ImagickDraw skewX()用法及代碼示例
- PHP ImagickDraw setStrokeWidth()用法及代碼示例
- PHP ImagickDraw translate()用法及代碼示例
- PHP ImagickDraw setStrokeOpacity()用法及代碼示例
- PHP ImagickDraw setGravity()用法及代碼示例
- PHP ImagickDraw setFillColor()用法及代碼示例
- PHP ImagickDraw setFont()用法及代碼示例
- PHP ImagickDraw setFontStyle()用法及代碼示例
- PHP ImagickDraw setFontSize()用法及代碼示例
- PHP ImagickDraw setFontWeight()用法及代碼示例
- PHP ImagickDraw setStrokeMiterLimit()用法及代碼示例
- PHP ImagickDraw setFillOpacity()用法及代碼示例
- PHP ImagickDraw setTextAntialias()用法及代碼示例
- PHP ImagickDraw setTextDecoration()用法及代碼示例
注:本文由純淨天空篩選整理自sarthak_ishu11大神的英文原創作品 PHP | ImagickDraw getStrokeOpacity() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。