Re: IntersectRect



Hows can I determine if one rect is within another rect? Is it the
IntersectRect function?

If you want to know whether two rectangles overlap one another at any point
then use the IntersectRect () API call and check for a non-0 return. If you
want to know whether one rectangle is completely within another then use the
same call, and use EqualRect() to test the intersected area against the
original rectangle - If you get back a non-0 return there then the rectangle
is completely contained within the other.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/


.



Relevant Pages

  • Re: IntersectRect
    ... point then use the IntersectRect API call and check for a non-0 return. ... If you want to know whether one rectangle is completely within another ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Intersecting Polygons
    ... Public Declare Function IntersectRect Lib "user32" Alias "IntersectRect" ... (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) ... places the coordinates of the intersection rectangle into the destination rectangle. ...
    (microsoft.public.vb.general.discussion)
  • Re: TRect overlap
    ... > What happens is one Rect is inside the other? ... Will IntersectRect still ... Another way to do it is just check if any points of either rectangle are ... Prev by Date: ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: API Drawing...
    ... you can only draw in a rectangle that appears on screen ... > appear like a rectangle with its edges parallel to the edges of the screen. ... > much like a line, but has a pattern, and a thickness of say 5 pixels. ... I must use the API to draw on it. ...
    (microsoft.public.vb.general.discussion)
  • API Drawing...
    ... you can only draw in a rectangle that appears on screen ... appear like a rectangle with its edges parallel to the edges of the screen. ... much like a line, but has a pattern, and a thickness of say 5 pixels. ... I must use the API to draw on it. ...
    (microsoft.public.vb.general.discussion)

Loading