Getting mouse points with App Designer

2 次查看(过去 30 天)
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;

回答(1 个)

Reza Mohammadi
Reza Mohammadi 2019-1-6
编辑:Reza Mohammadi 2019-1-6
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.

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by