How to "lock" UIAxes in AppDesigner?
12 次查看(过去 30 天)
显示 更早的评论
Hi,
i want to display an image in UIAxes in AppDesigner with the following code:
A = imread('icon.png');
imshow(A,'Parent',app.UIAxes);
which works fine. How can i prevent the image from being shiftable and zoomable inside the UIAxes, when trying to move the image with the mouse? It's meant to be a static logo in my GUI. I already tried:
zoom(app.UIAxes,'off');
but it doesn't change anything. I'm using Matlab 2018b.
Thanks for your help
Edit: as a workaround i put an empty Labelfield on top of the UIAxes, but this isnt a satisfying solution
0 个评论
采纳的回答
Cris LaPierre
2018-11-16
disableDefaultInteractivity(app.UIAxes)
If you want them back, they can be reenabled with
enableDefaultInteractivity(app.UIAxes)
4 个评论
Németh Gergely
2019-12-23
编辑:Németh Gergely
2019-12-23
Hi Guys,
It is nice that this answer was accepted, but for me it does not work at all in appdesigner.
I use disableDefaultInteractivity(app.UIAxes) in my startup function, but it does not do anything. I tried it with button callbacks and it did not work.
Do you know something that can help?
Cris LaPierre
2019-12-23
Are you wanting to do the same thing as the original poster? Namely, add an image to a UIAxes and then prevent users from shifting or zooming it? I ask because you said you tried this with a button callback.
What did you call your axes? Look in the Component Browser. If your axes is not named app.UIAxes, then you'd need to update the code with the name you gave your axes.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!