Re: Problem with "IntersectsWith" function in GDI+
- From: "Doug Forster" <nobody@nowhere,com>
- Date: Fri, 23 Nov 2007 13:24:36 +1300
If the builtin behaviour doesn't suit then its just a trivial coding
exercise to do your own intersection test with whatever boundary rules you
like.
Cheers
Doug Forster
"Ranjit" <Ranjit@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9E354B34-0D2B-423A-85D3-BFE8BD6F517A@xxxxxxxxxxxxxxxx
Hi All,
I am working on .Net Framework 2.0 (Graphics module). I am facing a
strange problem w.r.t IntersectsWith function which is used to determine
whether two given rectangles intersect with each other (or) not.
I have two cases where the rectangles in both the cases touch
exactly with one another, but the result of the function returns
FALSE in case 1
&
TRUE in case 2.
Case-1
Dim firstRectangleF As New RectangleF(720.7F, 618.0F, 30.7F, 12.2F)
Dim secondRectangleF As New RectangleF(690.0F, 618.0F, 30.7F, 12.2F)
MessageBox.Show(firstRectangleF.IntersectsWith(secondRectangleF))
ANSWER: Returns FALSE
Case-2
Dim firstRectangleF As New RectangleF(782.1F, 618.0F, 30.7F, 12.2F)
Dim secondRectangleF As New RectangleF(751.4F, 618.0F, 30.7F, 12.2F)
MessageBox.Show(firstRectangleF.IntersectsWith(secondRectangleF))
ANSWER: Returns TRUE
In both the cases, rectangles are placed side by side(Y is constant),
with one edge overlapping. Draw the same coordinate rectangles on a
window
for simulation.
Please, Can any one can help what could be the actual problem, how can we
avoid this problem?
.
- Follow-Ups:
- Re: Problem with "IntersectsWith" function in GDI+
- From: Michael C
- Re: Problem with "IntersectsWith" function in GDI+
- Prev by Date: Re: Problem with "IntersectsWith" function in GDI+
- Next by Date: Re: Problem with "IntersectsWith" function in GDI+
- Previous by thread: Re: Problem with "IntersectsWith" function in GDI+
- Next by thread: Re: Problem with "IntersectsWith" function in GDI+
- Index(es):
Relevant Pages
|