(PECL imagick 2, PECL imagick 3)
ImagickDraw::arc — Dessine un arc
Description
public
ImagickDraw::arc(
float
$sx
,
float
$sy
,
float
$ex
,
float
$ey
,
float
$sd
,
float
$ed
): bool
Avertissement
Cette fonction est actuellement non documentée ; seule la liste des arguments est disponible.
Dessine un arc, placé à l'intérieur d'un rectangle.
Liste de paramètres
-
sx
-
Abscisse du point de début d'arc dans le rectangle d'encadrement
-
sy
-
Ordonnée du point de début d'arc dans le rectangle d'encadrement
-
ex
-
Abscisse du point de fin d'arc dans le rectangle d'encadrement
-
ey
-
Ordonnée du point de fin d'arc dans le rectangle d'encadrement
-
sd
-
Degré de rotation initial
-
ed
-
Degré de rotation final
Valeurs de retour
Aucune valeur n'est retournée.
Exemples
Exemple #1 Exemple avec imagickdraw::arc()
<?php
function arc($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $startAngle, $endAngle) {
//Create a ImagickDraw object to draw into.
$draw = new \ImagickDraw();
$draw->setStrokeWidth(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->arc($startX, $startY, $endX, $endY, $startAngle, $endAngle);
//Create an image object which the draw commands can be rendered into
$image = new \Imagick();
$image->newImage(IMAGE_WIDTH, IMAGE_HEIGHT, $backgroundColor);
$image->setImageFormat("png");
//Render the draw commands in the ImagickDraw object
//into the image.
$image->drawImage($draw);
//Send the image to the browser
header("Content-Type: image/png");
echo $image->getImageBlob();
}
?>