Drawing an Arc in Imagick

June 19th, 2009

Warning: This post is 14 years old. Some of this information may be out of date.

Here's how to draw an arc using PHP Imagick

$canvas = new Imagick();
$canvas->newImage(200, 200, new ImagickPixel("white"),'png');

$arc = new ImagickDraw();

/* x1,x2,y1,y2, start angle, end angle */
$arc->arc(30, 30, 160, 160, -70, 70);

$canvas->borderImage('black', 1, 1);
header('content-type: image/png');
echo $canvas->getImage();


Drawing an arc with Imagemagick and PHP