Page 1 of 1

Black line doesn't get drawn

Posted: 2008-11-02T14:52:00-07:00
by el_supremo
[EDIT]
Version: ImageMagick 6.4.4 2008-10-09 Q8 http://www.imagemagick.org
on Win XP Pro SP3
[/EDIT]
The code below creates a white canvas, draws a circle and a rectangle on it and then writes the result.
Both the circle and rectangle have a fill defined to be red. If the stroke colour is anything except pure black then it is drawn around the perimeter of the square and circle. But if the stroke colour is pure black it isn't drawn.
A bug, or am I missing something?

Code: Select all

#include <windows.h>
#include <wand/magick_wand.h>

void test_wand(void)
{
	MagickWand *m_wand = NULL;
	DrawingWand *d_wand = NULL;
	PixelWand *c_wand = NULL;
	unsigned long radius,diameter;

	diameter = 640;
	radius = diameter/2;

	MagickWandGenesis();

	m_wand = NewMagickWand();
	d_wand = NewDrawingWand();
	c_wand = NewPixelWand();

	PixelSetColor(c_wand,"white");
	MagickNewImage(m_wand,diameter,diameter,c_wand);

	DrawSetStrokeOpacity(d_wand,1);

PushDrawingWand(d_wand);
	// This will draw the stroked outline but if
	// the stroke colour is changed to "black" or
	// "rgb(0,0,0)" it won't show in the final image  
	PixelSetColor(c_wand,"rgb(0,0,1)");

	DrawSetStrokeColor(d_wand,c_wand);
	DrawSetStrokeWidth(d_wand,4);
	DrawSetStrokeAntialias(d_wand,1);
	PixelSetColor(c_wand,"red");
	DrawSetFillColor(d_wand,c_wand);

	DrawCircle(d_wand,radius,radius,radius,radius*2);
	DrawRectangle(d_wand,50,13,120,87);
PopDrawingWand(d_wand);

	MagickDrawImage(m_wand,d_wand);
	MagickWriteImage(m_wand,"chart_test.jpg");

	c_wand = DestroyPixelWand(c_wand);
	m_wand = DestroyMagickWand(m_wand);
	d_wand = DestroyDrawingWand(d_wand);

	MagickWandTerminus();
}
Pete

Re: Black line doesn't get drawn

Posted: 2008-11-03T11:52:53-07:00
by magick
We have an drawing optimization that causes the problem. We will have a patch in the ImageMagick Subversion trunk by tomorrow to repair the problem. Thanks.