Sure thing. Here you go. Please let me know if you need anything else.
Code: Select all
/*
* gcc `MagickWand-config --cflags --cppflags` -o arcbug arcbug.c `MagickWand-config --ldflags --libs`
*/
#include <stdio.h>
#include <stdlib.h>
#include <wand/MagickWand.h>
int main(int argc, char **argv)
{
MagickWand *wand;
DrawingWand *drawing;
PixelWand *red, *white;
MagickWandGenesis();
red = NewPixelWand();
PixelSetColor(red, "red");
white = NewPixelWand();
PixelSetColor(white, "white");
drawing = NewDrawingWand();
DrawSetFillColor(drawing, red);
DrawPathStart(drawing);
DrawPathMoveToAbsolute(drawing, 600.0, 81.0);
DrawPathEllipticArcAbsolute(drawing, 107.0, 107.0, 0.0, MagickFalse, MagickTrue, 600.0, 295.0);
DrawPathEllipticArcAbsolute(drawing, 107.0, 107.0, 0.0, MagickFalse, MagickTrue, 600.0, 81.0);
DrawPathClose(drawing);
DrawPathMoveToAbsolute(drawing, 600.0, 139.0);
DrawPathEllipticArcAbsolute(drawing, 49.0, 49.0, 0.0, MagickFalse, MagickTrue, 600.0, 237.0);
DrawPathEllipticArcAbsolute(drawing, 49.0, 49.0, 0.0, MagickFalse, MagickTrue, 600.0, 139.0);
DrawPathClose(drawing);
DrawPathFinish(drawing);
wand = NewMagickWand();
MagickNewImage(wand, 1200, 400, white);
MagickDrawImage(wand, drawing);
MagickWriteImage(wand, "arcbug.png");
MagickWriteImage(wand, "arcbug.mvg");
DestroyDrawingWand(drawing);
DestroyMagickWand(wand);
DestroyPixelWand(red);
DestroyPixelWand(white);
MagickWandTerminus();
}
Here's the arcbug.mvg file:
Code: Select all
fill '#FFFF00000000'
path 'M600,81A107,107 0 0 1 600,295 107,107 0 0 1 600,81ZM600,139
A49,49 0 0 1 600,237 49,49 0 0 1 600,139Z'
For comparision, here's the path element from the SVG example:
Code: Select all
<path d="M 600,81 A 107,107 0 0,1 600,295 A 107,107 0 0,1 600,81 z
M 600,139 A 49,49 0 0,1 600,237 A 49,49 0 0,1 600,139 z" />
Here's the arcbug.png file: