Allow user to draw a line using mouse
6 ビュー (過去 30 日間)
古いコメントを表示
How can I get a user to draw a line using their mouse in an App Designer app using R2019a?
Edit: If App Designer does not support it, will GUIDE?
Thanks in advance.
2 件のコメント
Ajay Kumar
2019 年 11 月 14 日
編集済み: Ajay Kumar
2019 年 11 月 14 日
Do you mean line on the axes in uifigure?
採用された回答
Adam Danz
2019 年 11 月 14 日
編集済み: Adam Danz
2019 年 11 月 14 日
If you have the image processing toolbox, use drawline(). Something will have to trigger the function such as a button press or context menu selection. The example below responds to a button press which will then allow the user to click-and-drag a single line on an existing UIAxes.
function ButtonPushed(app, event)
hold(app.UIAxes, 'on')
drawline(app.UIAxes)
% ^^^^^^^^^^ your ui axis handle
end
16 件のコメント
Adam Danz
2019 年 11 月 16 日
Ok, good! If you start using a more recent release you could implement it in app designer, too (r2019b or later).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!