ImagickDraw::setStrokeDashArray

(PECL imagick 2.0.0)

ImagickDraw::setStrokeDashArraySpecifies the pattern of dashes and gaps used to stroke paths

说明

ImagickDraw::setStrokeDashArray ( array $dashArray ) : bool
Warning

本函数还未编写文档,仅有参数列表。

Specifies the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents an array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. To remove an existing dash array, pass a zero number_elements argument and null dash_array. A typical strokeDashArray_ array might contain the members 5 3 2.

参数

dashArray

array of floats

返回值

成功时返回 TRUE

范例

Example #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();
}

?>

相关文章
php imagickdraw returns the current stroke antialias settingphp imagickdraw returns the color used for stroking object outlinesphp imagickdraw returns an array representing the pattern of dashes and gaps used to stroke pathsphp imagickdraw returns the offset into the dash pattern to start the dashphp imagickdraw returns the shape to be used at the corners of paths when they are strokedphp imagickdraw returns the width of the stroke used to draw object outlinesphp imagickdraw terminates a pattern definitionphp imagickdraw indicates that subsequent commands up to a imagickdraw oppattern command comprise the definition of a named patternphp imagickdraw sets the fill color to be used for drawing filled objectsphp imagickdraw sets the url to use as a fill pattern for filling objectsphp imagickdraw specifies the pattern of dashes and gaps used to stroke pathsphp imagickdraw specifies the offset into the dash pattern to start the dashphp imagickdraw specifies the shape to be used at the end of open subpaths when they are strokedphp imagickdraw specifies the shape to be used at the corners of paths when they are strokedphp imagickdraw specifies the miter limitphp imagickdraw specifies the opacity of stroked object outlinesphp imagickdraw sets the pattern used for stroking object outlinesphp imagickdraw sets the width of the stroke used to draw object outlinesphp intldateformatter get the pattern used for the intldateformatterphp messageformatter set the pattern used by the formatter
关注编程学问公众号