Alex Rivera | Logout

Border in DrawRectangle

Asked 2009-05-29T11:17:13.073
35

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:

removed dead ImageShack link

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.

Edit
Report

1 Answer

0

I guess not... but you may move the drawing position half the pen size to the bottom right

answered 2009-05-29T11:21:42.317

Your Answer