Imshow in App Designer (Image size doesn't fit)
Mostra commenti meno recenti
Hey Guys,
the size of imshow in app designer doesn't fit, when I start the application (see picture and code below). Is it possible, that the image have the same size as the UiAxes in app designer?


function startupFcn(app)
imshow('Flower.jpg','parent',app.UIAxes)
end
Thank you very much for your help. Best regards Erdal
1 Commento
Varun Gunda
il 16 Ott 2017
Can you share more information on what exactly you are trying to do? The explanation is not clear.
May be this code helps you out in displaying image as you are looking for:
RGB = imread('Flower.jpg');
ax = uiaxes(app.UIFigure,'Position',[10 10 390 390]);
image(RGB,'Parent',ax);
set(ax,'visible','off');
Also, check the dimensions of the 'Flower.jpg' which gets reflected on the app.
Risposta accettata
Più risposte (3)
Melinda Toth-Zubairi
il 26 Mar 2019
1 voto
If your goal is just to display a static image, starting R2019a you can use the uiimage function to create an image component in your App Designer app.
See the following related answer for more information:
3 Commenti
Royi Avital
il 9 Nov 2019
The uiimage() function is very limited compared to what we have in regular figures.
Eric Sargent
il 9 Dic 2020
Royi, what is the limitation(s) you're running into?
Francis Burton
il 7 Mar 2021
It isn't possible to capture mouse down events in a uiimage in App Designer apps, so clicking and dragging inside an image - e.g. to draw a rubber band box for selection of points in the image - isn't possible at the moment. WindowButtonDownFcn events are intercepted/filtered when the mouse is inside the image.
So one is obliged to use UIAxes instead. This doesn't intercept mouse events in the app figure window. However, drawing images using imshow is still problemmatic I have found, using the code above. Setting the size (in pixels) of the axes to that of the image doesn't result in one-to-one pixel correspondence i.e.truesize behaviour. There is still a border around the image itself, albeit a narrow one.
There may also be performance issues with UIAxes compared to (UI)Image. Changing the image and refreshing the display seems to be slower with imshow vs setting Image.ImageSource.
Erdal Schranz
il 17 Ott 2017
0 voti
Erdal Schranz
il 20 Ott 2017
0 voti
Categorie
Scopri di più su Display Image in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

