-
rect size problem
In OnLButtonDown(...) I got CPoint p1.
In OnMouseMove(...) I got CPoint p2.
Then I have a rect CRect rect(p1.x,p1.y,p2.x,p2.y).
I think the size of rect should be:
width=p2.x-p1.x+1
height=p2.y-p1.y+1
but rect.Width()=p2.x-p1.x while rect.Height()=p2.y-p1.y
What's the problem?
If I want to get the bitmap covered by the rect,
what about the size of bitmap? rect.Height() or
rect.Height()+1? The start point and end point of
bitmap?
Thanks,
-
Re: rect size problem
one point .... (3,4)
another point ..... (10,7)
above points are diagonal point of rectangle
What is the Surface?
Surface = width * height;
so Surface = (10-3)*(7-4),
not Surface = (10-3+1)*(7-4+1),
I don't know. sorry.!
by nfuox
-
Re: rect size problem
Is the diagonal point of the Surface (3,4) and (10-1,7-1)?
Thanks for your reply,