Re: DrawRectangle positioning
- From: "Jon Slaughter" <Jon_Slaughter@xxxxxxxxxxx>
- Date: Thu, 26 Oct 2006 14:24:29 GMT
"Kevin Spencer" <spam@xxxxxxx> wrote in message
news:OVhx$NP%23GHA.1200@xxxxxxxxxxxxxxxxxxxxxxx
Hi Jon,
I'm not surprised that you've had difficulty with this issue, as it is not
well-documented in the .Net SDK. The crux of the matter is this: When you
draw a rectangle with a pen, the width of the pen must be taken into
account with regards to the size of the target rectangle. There are 3
basic logical possibilities:
1. The entire line is drawn *inside* the rectangle.
2. The width of the line is split, so that the edge of the rectangle is
centered in the line.
3. The entire line is drawn *outside* the rectangle.
It turns out that number *2* is the method employed with GDI+.
The following is an excellent and detailed article on the subject:
http://www.bobpowell.net/beginnersgdi.htm
Thanks. I figured it was 2 because the other 2 I tried didn't work. At first
I thought it was a mixture of 1 and 2(the left and top being on the inside
and the bottom and right being on the outside) but none of my calculations
worked and I couldn't find any info regarding it.
Thanks again,
Jon
.
- References:
- DrawRectangle positioning
- From: Jon Slaughter
- Re: DrawRectangle positioning
- From: Kevin Spencer
- DrawRectangle positioning
- Prev by Date: Re: GDI+ Z-order?
- Next by Date: Re: Use of properties
- Previous by thread: Re: DrawRectangle positioning
- Next by thread: Generics documentation
- Index(es):
Relevant Pages
|
Loading