How can I mouse pick up and move
조회 수: 1 (최근 30일)
이전 댓글 표시
For example, in following figure
I want to pick up the ball and move the position by mouse!
example code or matlab function is good
댓글 수: 0
답변 (1개)
Rik
2021년 9월 14일
편집: Rik
2021년 9월 14일
Inside that callback you can retrieve the current position of the cursor (CurrentPoint) and set a flag so your WindowButtonMotionFcn can do interesting things like changing the XData and YData properties of your ball.
When the button is released you can set a flag to make the motion function return immediately after it starts (or wipe the property).
If you want a working example: you might be able to find examples on the File Exchange, but you can also have a look at my WindowLevel function, which also responds on dragging.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dialog Boxes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!