array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'imagickdraw.setstrokemiterlimit.php', 1 => 'ImagickDraw::setStrokeMiterLimit', ), 'up' => array ( 0 => 'class.imagickdraw.php', 1 => 'ImagickDraw', ), 'prev' => array ( 0 => 'imagickdraw.setstrokelinejoin.php', 1 => 'ImagickDraw::setStrokeLineJoin', ), 'next' => array ( 0 => 'imagickdraw.setstrokeopacity.php', 1 => 'ImagickDraw::setStrokeOpacity', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/imagick/imagickdraw/setstrokemiterlimit.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
ImagickDraw::setStrokeMiterLimit — Spécifie la limiter miter
Cette fonction est actuellement non documentée ; seule la liste des arguments est disponible.
Spécifie la limiter miter. Lorsque deux lignes se rejoignent à angle aigu,
et que la limite miter a été configuré à "lineJoin"
, il est
possible que le miter dépasse l'épaisseur de la ligne. La limite miter impose
un ratio entre la longueur de miter et l'épaisseur de la ligne
"lineWidth"
.
miterlimit
La limiter miter
Aucune valeur n'est retournée.
Exemple #1 Exemple avec ImagickDraw::setStrokeMiterLimit()
<?php
function setStrokeMiterLimit($strokeColor, $fillColor, $backgroundColor) {
$draw = new \ImagickDraw();
$draw->setStrokeColor($strokeColor);
$draw->setStrokeOpacity(0.6);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(10);
$yOffset = 100;
$draw->setStrokeLineJoin(\Imagick::LINEJOIN_MITER);
for ($y = 0; $y < 3; $y++) {
$draw->setStrokeMiterLimit(40 * $y);
$points = [
['x' => 22 * 3, 'y' => 15 * 4 + $y * $yOffset],
['x' => 20 * 3, 'y' => 20 * 4 + $y * $yOffset],
['x' => 70 * 5, 'y' => 45 * 4 + $y * $yOffset],
];
$draw->polygon($points);
}
$image = new \Imagick();
$image->newImage(500, 500, $backgroundColor);
$image->setImageFormat("png");
$image->drawImage($draw);
$image->setImageType(\Imagick::IMGTYPE_PALETTE);
$image->setImageCompressionQuality(100);
$image->stripImage();
header("Content-Type: image/png");
echo $image->getImageBlob();
}
?>