Border in DrawRectangle

Posted by undsoft on Stack Overflow See other posts from Stack Overflow or by undsoft
Published on 2009-05-29T11:17:13Z Indexed on 2010/04/27 10:53 UTC
Read the original article Hit count: 252

Filed under:
|

Well, I'm coding the OnPaint event for my own control and it is very nescessary for me to make it pixel-accurate.

I've got a little problem with borders of rectangles.

See picture:

alt text

These two rectangles were drawn with the same location and size parameters, but using different size of the pen. See what happend? When border became larger it has eaten the free space before the rectangle (on the left).

I wonder if there is some kind of property which makes border be drawn inside of the rectangle, so that the distance to rectangle will always be the same. Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about graphics