Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.basic.misc > Newsgroup comp.lang.basic.visual.misc

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2012, 01:52 PM
-mhd
Guest
 
Posts: n/a
Default Question about RECT

Are the values represented by Right and Bottom supposed to be absolute or
relative to Left and Top?

-mike
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 08-07-2012, 02:08 PM
Deanna Earley
Guest
 
Posts: n/a
Default Re: Question about RECT

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.)
Reply With Quote
  #3 (permalink)  
Old 08-07-2012, 03:10 PM
-mhd
Guest
 
Posts: n/a
Default Re: Question about RECT

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
Reply With Quote
  #4 (permalink)  
Old 08-07-2012, 05:04 PM
Farnsworth
Guest
 
Posts: n/a
Default Re: Question about RECT

"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.



Reply With Quote
  #5 (permalink)  
Old 08-07-2012, 05:24 PM
Deanna Earley
Guest
 
Posts: n/a
Default Re: Question about RECT

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.)
Reply With Quote
  #6 (permalink)  
Old 08-08-2012, 02:19 AM
Farnsworth
Guest
 
Posts: n/a
Default Re: Question about RECT

"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.


Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:42 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.