CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    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,


  2. #2
    Join Date
    Apr 1999
    Location
    SungNam KyungKi Korea
    Posts
    14

    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

  3. #3
    Join Date
    Apr 1999
    Posts
    3

    Re: rect size problem

    Is the diagonal point of the Surface (3,4) and (10-1,7-1)?

    Thanks for your reply,



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured