Drawing outline inside box. How are coordinates set up?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
aLabelMaker
Posts: 19
Joined: 2011-01-10T12:25:14-07:00
Authentication code: 8675308

Drawing outline inside box. How are coordinates set up?

Post by aLabelMaker »

I am trying to draw a box inside a canvas that measures 600x263. The size of box I am trying to draw inside measures 594x257. When I put in this code, everything is good except there is no bottom of the box. It just draws a line on the top and both sides leaving the bottom blank. How do I complete and close the box? How are the coordinates set up in IM? (X,Y)?

convert -size 600x263 xc:white -stroke black
-linewidth 3 -fill white -draw "rectangle 3,3 597,597"
cv.png

Thanks for your help. I am new to IM.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Drawing outline inside box. How are coordinates set up?

Post by Bonzo »

That is because your bottom line is outside the original box.

Original box is 600x263

New rectangle is 594 x 594 offset 3px from top left corner

Try 3,3 597,260

First two numbers are the start point of the box and the second two numbers are the end point. Both measured from the top left corner which is 0,0
Post Reply