AppDesigner - images intermittently not rendering during pan/zoom + other poor behavior
6 次查看(过去 30 天)
显示 更早的评论
Hello,
(Matlab 2020b) I am having an issue where images or data plotted using image, imshow, or imagesc will behave very poorly during pan/zoom in an app built using AppDesigner (so in a UIFigure + UIAxes). These issues include -
- Vanishing entirely after pan/zoom: Resizing the figure window sometimes fixes this, reset view (home button) sometimes fixes it, another pan/zoom sometimes fixes it, and sometimes it the image just wont render until I have done some combination of the above.
- Vanishes intermittently during pan: unlike in a regular figure+axes, the plot will flicker midway through a pan operation, sometimes coming back as I continue to pan, and sometimes not.
- XLim/YLim hopping after pan/zoom: after releasing the pan or zoom (buttonUp on the mouse) the axis limits will often hop around several times. It looks like there are several automatic resizing callbacks that are getting in each others way, but I don't know that for sure. It is especially bad if I had alread started another panning operation.
This makes it very difficult to imagine building a professional quality app that involves image display with pan/zoom allowed. Some other notes:
- This seems to get worse with larger images. However, I have managed to replicate the behavior with very modest image sizes.
- I have replicated this on two machines using different hardware.
- I have tried flipping every switch I can think of in UIAxes - interruptable, nextplot, busyaction, plotboxaspectratio, etc. and even switched the renderer to opengl- no joy.
- These problems are not present when using a regular figure + axes. If I could child a plain axes to a uifigure I would, but I cannot.
I cannot copy/paste the app code, but the quickest way to try to replicate this is to:
- Create a new app in appdesigner
- Add an Axes to the app
- Modify the startupFcn to read:
img = rand(1000,4000); % large so its easy to see the issue
imagesc(app.UIAxes,img);
axis(app.UIAxes, 'equal')
4. Start panning and zooming to see these issues
Any solution that fits "I want to smoothly pan and zoom an image plot within a Matlab app, without rendering issues" is welcomed. I just cannot fathom how the pan/zoom and general axes functionality is so much worse in the appdesigner and UIAxes than in normal Matlab figures.
Cheers,
-Dan
3 个评论
Adam Danz
2021-4-2
You have to fill in the Product first before the release field becomes enabled. I've mentioned this stumbling block to developers in the past so they are aware of it, but thanks for explaining.
And thanks for the update to confirm that r21a fixed it for you.
采纳的回答
Daniel Plotnick
2021-4-2
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!