필터 지우기
필터 지우기

fix only one end of imline object

조회 수: 2 (최근 30일)
Yinan Xuan
Yinan Xuan 2018년 8월 24일
댓글: Image Analyst 2018년 8월 24일
I have checked the setConstrainedPosition feature, but it seems to only constrain both ends. What I want to achieve is to fix one end of imline object while leave the other end freely movable. Thanks in advance!

답변 (1개)

Image Analyst
Image Analyst 2018년 8월 24일
I don't think you can do that with imline(). What you'd have to do is to use the mouse move callback to erase the prior line and draw a new line, with line() not imline(), from the fixed point to the current point where the cursor is.
  댓글 수: 2
Yinan Xuan
Yinan Xuan 2018년 8월 24일
Thanks for your reply! However, in the case where there are two lines present at the same time. How can I choose which one to "drag" in your method?
Image Analyst
Image Analyst 2018년 8월 24일
You have the current point. Then you can look up "point line distance" on the web for a formula. I'd move which ever line is closest to your current point.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by