Simple solution - 
path defines the centerline of the stroke.
I was defining the path to far away from the image.

The correct drawing should be:
convert rose: -resize 300x200! –background none –border 20 –bordercolor none
-strokewidth 20 –stroke blue –fill none
-draw “stroke-dasharray 20 20 path 'M 10,10 h 330' ”
-draw “stroke-dasharray 20 20 path 'M 330,10 v 230' ”
-draw “stroke-dasharray 20 20 path 'M 330, 230 h -300' ”
-draw “stroke-dasharray 20 20 path 'M 10, 230 h -200' ”




tdan wrote:
> 
> Goal: Draw a dashed border around an existing photo with known dimensions.
> Problem: My method creates a dashed border which is too thin.  It does not
> appear like a border.
> Progress:
> - I drew a transparent border around the image because I did not want the
> border drawn on the image itself.
>  I wanted it to act like a border or frame, hugging the image.
> - I used 4 draw commands so that the pathlines were straight and would not
> 'jump' between edges (try it with 1 path command).
> 
> 
> For testing try this:
> convert rose: -resize 300x200! –background none –border 20 –bordercolor
> none
> -strokewidth 20 –stroke blue –fill none
> -draw “stroke-dasharray 20 20 path 'M 0,0 h 300' ”
> -draw “stroke-dasharray 20 20 path 'M 300,0 v 200' ”
> -draw “stroke-dasharray 20 20 path 'M 300, 200 h -300' ”
> -draw “stroke-dasharray 20 20 path 'M 0, 200 h -200' ”
> 
> 
> If you try this from the command line, you will see the dashed line really
> is not 20px wide (at least on my monitor).
> Instead, it appears offset from the image ~9 pixels or so.
> Why?
> Is this an issue with SVG having different resolution than IM's native
> resolution?
> 

-- 
View this message in context: 
http://www.nabble.com/What-is-the-best-way-to-create-dashed-borders--tf3156096.html#a8754931
Sent from the Magick-users mailing list archive at Nabble.com.


_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to