Page 1 of 1

DrawPoint vs DrawLine color

Posted: 2013-04-11T11:56:17-07:00
by 168gr
Hopefully this has a simple answer. I can't figure out how to make DrawPoint() draw in any color other than black.

Trivial example:

Code: Select all

  DrawingWand *dw = NULL;
  PixelWand *pw = NULL;

  dw = NewDrawingWand();
  pw = NewPixelWand();
  ClearPixelWand( pw );
  PixelSetColor( pw, "#0000ff" );
  ClearDrawingWand( dw );
  DrawSetStrokeColor( dw, pw );
  DrawSetStrokeWidth( dw, 1 );
  DrawSetStrokeOpacity( dw, 1 );
  DrawSetFillOpacity( dw, 1 );


  DrawPoint( dw, x, y );
  DrawPoint( dw, x+1, y );
  DrawPoint( dw, x+2, y );

  DrawLine( dw, x, y+10, x+2, y+10 );


  MagickDrawImage( ffc_debug_image, dw );
I get a black line (from DrawPoint) and a blue line (from DrawLine).

Why isn't DrawPoint making blue pixels? Thanks.


ImageMagick 6.8.3-7
Cygwin environment on Windows 7.

Re: DrawPoint vs DrawLine color

Posted: 2013-04-11T21:00:25-07:00
by anthony
Drawpoint used fill color

Drawline uses fill and stroke color over the top.

See examples of CLI use at
http://www.imagemagick.org/Usage/draw/#primitives
And more nitty gritty a little further down in.
http://www.imagemagick.org/Usage/draw/#color

NOTE fill in lines is actually too-wide, and for a single line should probably be zero width (no fill).
But that is not what happens. See...
http://www.imagemagick.org/Usage/draw/#bounds