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:
  1. Create a new app in appdesigner
  2. Add an Axes to the app
  3. 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 个评论
Daniel Plotnick
Daniel Plotnick 2021-4-2
The answer turned out to be "its an issue in r2020b, but 2021a seems to have fixed it". I hadn't realized the new release was out.
As for adding the products/release, I was having a problem where the "release" scroll down and button is greyed out and gives me a red 'though shalt not pass' icon. I had the same issue when creating the post. Signing out and back in looks like it fixed that.
Adam Danz
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
Daniel Plotnick 2021-4-2
Problem appears to have been resolved in 2021a
  6 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by