What is the best way to create dashed borders?
Posted: 2007-02-01T09:43:46-07:00
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:
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?
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:
Code: Select all
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?