ImagickDraw::setStrokeDashArray

パスの描画に使用する破線のパターンを指定する

説明

public bool ImagickDraw::setStrokeDashArray(array $dashArray)
警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パスの描画に使用する破線のパターンを指定します。 strokeDashArray は数値の配列で、 互い違いに並べる破線と空白の長さをピクセルで表したものです。 If an odd number of values is provided, then the list of values is repeated to yield an even number of values. 既存の配列を削除するには、number_elements にゼロ、そして dash_array に null を渡します。 典型的な strokeDashArray_ 配列のメンバーは 5 3 2 となります。

パラメータ

dashArray

float の配列。

戻り値

成功した場合に true を返します。

例1 ImagickDraw::setStrokeDashArray の例

<?php
function setStrokeDashArray($strokeColor$fillColor$backgroundColor) {

    
$draw = new \ImagickDraw();

    
$draw->setStrokeColor($strokeColor);
    
$draw->setFillColor($fillColor);
    
$draw->setStrokeWidth(4);

    
$draw->setStrokeDashArray([1010]);
    
$draw->rectangle(10050225175);

    
$draw->setStrokeDashArray([20520555,]);
    
$draw->rectangle(27550400175);

    
$draw->setStrokeDashArray([2052055]);
    
$draw->rectangle(100200225350);

    
$draw->setStrokeDashArray([11112233558813132121343455558989144144233233377377610610987987159715972584258441814181,]);

    
$draw->rectangle(275200400350);

    
$image = new \Imagick();
    
$image->newImage(500400$backgroundColor);
    
$image->setImageFormat("png");
    
$image->drawImage($draw);

    
header("Content-Type: image/png");
    echo 
$image->getImageBlob();
}

?>