Hi, I have a problem with lines, rectangles and filled rectangles. For example, I want to draw a rectangle at location (10,10) with a size (10,10). It I use a pen with a width of 1 all is ok. If I use a pen with a width of 3 however things get bad. Meaning that instead the point (10,10) being EXACTLY in the upper left corner, the point (9,9) will be there, as .NET tries to have the "middle" of the line on the original point. So, I was wondering, if I do this:

dim k as integer
k = math.floor((mypen.width - 1 )/ 2)

and add k to the location.x and location.y, the rectangle should fall in the right place?

But what about the width and height. Probably I would have to reduce them both by 2*k ?

Does anybody know where I can read about this?

I have the same question for line: a line with width 3 has the (x,y) in the middle. But what about a line with width 4? Is the (x,y) on the "first middle pixel" or on the second??

I cannot even begin to say the problems with filling the rectangle. It looks too me like the fillrectangle fills the interior + the bottom line of the rectangle?

any help would be appreciated,

thank you,

iulian