Dynamicaly show size of imrect

조회 수: 2 (최근 30일)
Raldi
Raldi 2013년 1월 15일
Hi guys,
I wanted to know is there a way to make imrect show its x and y length while the user is moving it inside the axes. Is there something like a callback so i can get that data and display it next to the rectangle as the user resizes it.

답변 (1개)

Jan
Jan 2013년 1월 15일
See the Example 1 in doc imrect.
  댓글 수: 1
Image Analyst
Image Analyst 2013년 1월 15일
편집: Image Analyst 2013년 1월 15일
Wow, who ever would have guessed that code? Sometimes it seems like they go out of their way to make programming more difficult. I haven't tried it but it looks like they are putting the coordinates in the title of the axes, so if you had something there, you'll have to restore it. And I'm wondering if it blasted past the imrect call (so that it can do the addNewPositionCallback call) if you'll need a "position = wait(h);" line (as in their second example), otherwise it will go along blasting through all the rest of your code too, which you probably don't want.

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

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by