Functions For Helping FillRect

Alexandre Julliard julliard at winehq.org
Mon Oct 25 20:50:52 CDT 2004


William Poetra Yoga H <williampoetra at yahoo.com> writes:

> Oh, so:
>
> r.left = 10;
> r.top = 10;
> r.right = 60;
> r.bottom = 85;
> FillRect(hdc, &r, hbr);
>
>> > And for everything else when we have an x by y rectangle, we actually mean
>> > (x-1) by (y-1), is it OK to assume so? Am I correct?
>> 
>
> Will fill a 50x75 rectangle, with width of (60-10) and height of (85-10), am I
> correct here?

Yes.

> And, is my second assumption correct, btw? I mean,
> x = r.right - r.left + 1
> y = r.bottom - r.top + 1

I'm not sure what you mean, it seems you are trying to think too hard
about it; just don't worry about doing +1/-1, that should never be an
issue, just compute the limits the intuitive way. If you want an x by
y rectangle, just set right = left + x and bottom = top + y and
everything will behave properly.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list