need help using setPositionConstraintFcn
이전 댓글 표시
I want to use the imline tool to enable the user to draw a horizontal line on an image. From what I can tell I need to use setPositionConstraintFcn to assign constraints on imline but I can't figure out the syntax for this. Help is appreciated.
답변 (1개)
CC
2013년 8월 1일
Here is one example
h1=imline(handles.axes1,[0.5 0;0.5 8]); %the initial and end point positions
setColor(h1,[1 0 0]) % red color
fcn = makeConstrainToRectFcn('imline',[0 5],[-2 10]); % on x-axis, move between 0to 5, on y-axis, move between -2 to 10
setPositionConstraintFcn(h1,fcn);
카테고리
도움말 센터 및 File Exchange에서 Build Interactive Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!