|
|
||||
|
||||
|
|
|
|||
|
On 07/08/2012 14:52, -mhd wrote:
> 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/.../18/75652.aspx -- Deanna Earley (dee.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.) |
|
|||
|
Deanna Earley <dee.earley@icode.co.uk> wrote:
>On 07/08/2012 14:52, -mhd wrote: >> Are the values represented by Right and Bottom supposed to be absoluteor >> 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/.../18/75652.aspx Thanks for the answer and the link to the very informative article. -mike |
|
|||
|
"Deanna Earley" <dee.earley@icode.co.uk> wrote in message
news:jvr7hb$kp6$1@speranza.aioe.org... > On 07/08/2012 14:52, -mhd wrote: >> 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/.../18/75652.aspx > > -- > Deanna Earley (dee.earley@icode.co.uk) > 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. |
|
|||
|
On 07/08/2012 18:04, Farnsworth wrote:
> "Deanna Earley" <dee.earley@icode.co.uk> wrote in message > news:jvr7hb$kp6$1@speranza.aioe.org... >> On 07/08/2012 14:52, -mhd wrote: >>> 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/.../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 from MSDN: > The structure specifies the coordinates of two points: the upper left and lower right corners of the rectangle. and: > 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 (dee.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.) |
|
|||
|
"Deanna Earley" <dee.earley@icode.co.uk> wrote in message
news:jvrivu$moi$1@speranza.aioe.org... > On 07/08/2012 18:04, Farnsworth wrote: >> "Deanna Earley" <dee.earley@icode.co.uk> wrote in message >> news:jvr7hb$kp6$1@speranza.aioe.org... >>> On 07/08/2012 14:52, -mhd wrote: >>>> 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/.../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. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|