line in rectangle in mfc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zahraZ
    New Member
    • Jul 2010
    • 17

    #1

    line in rectangle in mfc

    hello every body,
    i draw a rectangle, and also a line with changeable finish point. this line in some place is in rectangle i want to find point of line that is in rectangle.
    what should i do????????????
    Regard,
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    Find intersection of the line with rectangle's sides. Then find if these intersection points belong to the segments of the rectangle.

    Comment

    • zahraZ
      New Member
      • Jul 2010
      • 17

      #3
      I know , and also i write code of it but it didn't work.
      Can you explain it with code?
      Thanks

      Comment

      • newb16
        Contributor
        • Jul 2008
        • 687

        #4
        It's very unlikely that I will code and test the solution to the task like this only to send it to you and then discard. If you have some code (checking for intersection? intersection belonging to the segment?) post it here with test cases that show that it doesn't work.

        Comment

        • zahraZ
          New Member
          • Jul 2010
          • 17

          #5
          Thanks, i find answer to my question.
          again Thanks.

          Comment

          Working...