Keep zoom in when displaying an image and zoom out after
Show older comments
Hello,
I am working on an interface using Guide on Matlab R2015a. What I would like is to be able to zoom in an image ploted on a figure of my gui, and then keeping my xlim and ylim when I display this image. I found how to do this getting the xlim and ylim of the figure juste before the display. What I have to do is set these limits to the new figure like this:
xlim = get(axes.handles, 'XLim');
display_image;
set(axes.handles, 'XLim', xlim);
But if I want to zoom out after, I can't because my axes are now the last ones (that I setted manually). Did I miss something to be able to zoom out after a zoom in and a display? I think it is just a little thing to know but I don't find.
Thank you in advance for your help.
Accepted Answer
More Answers (1)
Image Analyst
on 20 Jul 2015
0 votes
Zooming an image is tricky. See the attached demo which I got from the Mathworks on how to use a "imscrollpanel".
Categories
Find more on Data Exploration 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!