Zooming image with no border
Afficher commentaires plus anciens
I have a window that shows an image that I need to zoom in and out on, but I would like to get rid of the grey border that frames the image when zooming in. Examples below.
I'm guessing I need to somehow change the 'inner frame' dimensions to fill the window instead of it having the aspect ratio of the full image. I have tried the Border property but it only affects it in relation to the full image aspect ratio.
Full image:

Zoomed image:

Réponses (1)
Walter Roberson
le 1 Juin 2016
0 votes
Consider that if you had only zoomed by a small fraction then you would not expect the image to suddenly jump to fill the entire vertical space: you would probably expect instead that as you zoomed it would take up more and more of the vertical space until it reached the edge.
What you will probably want to do is give an ActionPostCallback on the zoom, that figures out the best InnerPosition to use taking into account the xlim and ylim and the image size and the available area. See http://blogs.mathworks.com/community/2007/12/10/focused-on-zooming/
Catégories
En savoir plus sur Data Exploration dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!