Clear Filters
Clear Filters

Getting mouse points with App Designer

2 views (last 30 days)
qiana curcuru
qiana curcuru on 22 Feb 2018
Edited: Reza Mohammadi on 6 Jan 2019
I realize that App designer does not support interactive figure manipulation, but I am wondering if I can find a workaround by opening a separate figure window (not a UI window) with my graphic displayed on it so that I can still get the location of my mouse clicks. Currently the code below displays the figure on my GUI, and then opens another blank figure that records my mouse clicks. This is fine, but I need to also display the figure in the new window as well, and am having trouble doing so.
first frame = vid(:,:,:,1);
imshow(firstframe,'Parent',app.UIAxes);
[centers_X centers_Y]=getpts;

Answers (1)

Reza Mohammadi
Reza Mohammadi on 6 Jan 2019
Edited: Reza Mohammadi on 6 Jan 2019
Hello
You can edit your code as follow:
myImage = imread('your image');
fig = figure
imshow(myImage)
[x y] = getpts(fig)
This code work in app designer without the using uifigure.

Categories

Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!