Discussion:
Question about RECT
(too old to reply)
-mhd
2012-08-07 13:52:52 UTC
Permalink
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?

-mike
Deanna Earley
2012-08-07 14:08:45 UTC
Permalink
Post by -mhd
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?
They are the absolute right and bottom coordinates*. If they were
relative, they would be called width and height.

* exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
-mhd
2012-08-07 15:10:36 UTC
Permalink
Post by Deanna Earley
Post by -mhd
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?
They are the absolute right and bottom coordinates*. If they were
relative, they would be called width and height.
* exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
Thanks for the answer and the link to the very informative article.

-mike
Farnsworth
2012-08-07 17:04:07 UTC
Permalink
Post by Deanna Earley
Post by -mhd
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?
They are the absolute right and bottom coordinates*. If they were
relative, they would be called width and height.
* exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
--
i-Catcher Development Team
http://www.icode.co.uk/icatcher/
You probably were thinking of something else. Right and Bottom are always
relative to Left and Top. Some functions always set Left and Top to 0, such
as GetClientRect(), but not GetWindowRect(), so subtracting from Left and
Top always gets you the correct numbers.
Deanna Earley
2012-08-07 17:24:17 UTC
Permalink
Post by Farnsworth
Post by Deanna Earley
Post by -mhd
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?
They are the absolute right and bottom coordinates*. If they were
relative, they would be called width and height.
* exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
You probably were thinking of something else. Right and Bottom are always
relative to Left and Top.
No they're not.
If what you say is true, it makes that entire article rubbish, and this
Post by Farnsworth
The structure specifies the coordinates of two points: the upper left and lower right corners of the rectangle.
The coordinate value of a rectangle's right side must be greater than that of its left side.
Some functions always set Left and Top to 0, such
as GetClientRect(), but not GetWindowRect(), so subtracting from Left and
Top always gets you the correct numbers.
You've just contradicted yourself there. subtracting makes no sense if
they're relative anyway (Only addition would be necessary).

Having said all that, A RECT is purely a container so it's entirely down
to the creator and consumer to agree on how to interpret it. Accepted
practice says top left inclusive to bottom right exclusive.
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
Farnsworth
2012-08-08 02:19:38 UTC
Permalink
Post by Deanna Earley
Post by Farnsworth
Post by Deanna Earley
Post by -mhd
Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?
They are the absolute right and bottom coordinates*. If they were
relative, they would be called width and height.
* exclusive. 10,10 to 20,20 will give you a 10x10 box from 10,10 to 19,19.
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/18/75652.aspx
You probably were thinking of something else. Right and Bottom are always
relative to Left and Top.
No they're not.
I guess I was trying to say something else. I was thinking perhaps of
related than relative. That's what happens when I don't get Caffine for 24
hours and not enough sleep as well.

Loading...