Recommended Posts

Hi, I'm trying to figure out something but I need some help.
What I'm trying to figure out is: Why does the 7 Windows functions for drawing filled areas with (Rectangle, Ellipse, RoundRect, Chord, Pie, Polygon, PolyPolygon., including; FillRect, ExcludeRect etc..), exclude the right and bottom edges?
Example:
Horizontal Client Width: 50
Vertical Client Height: 100
GetClientRect(hwnd, &rect);
FillRect(hdc, &rect, GetStockObject(WHITE_BRUSH));
rect.right would be 50 and rect.bottom would be 100, but since FillRect does not include the right and bottom edges/sides, they would actually be 49, 99 respectively. Therefore, the client area's right, and bottom edges would not get Erased (by one pixel) with the WHITE_BRUSH. This all makes sense until I actually try it out and it turns out that the right and bottom edges does get erased. This is contrary to what I thought would happen, because of the right and bottom edge exclusions.
Why is this so?...
One theory that I came up with is that; Client coordinates as we all know, start at 0 (top colum), 0 (top row), like arrays, and, FillRect or any other abovementioned function to actually include the right and bottom edges for filling would go beyond the windows client borders because 50 would become 51 and 100 would become 101 because, 0 through 50 = 51, 0 through 100 = 101 respectively. And so that's why FillRect excludes the right and bottom sides.
But I think I'm wrong, of course [embarrass]
This might seem like it's unnecessary to know, but, I'm that kinda person that likes to know all the In's and Out's so I would really be greatful if someone could explain to me why this is happening.
relient.