How to display an image in UI Figure on app designer?

773 views (last 30 days)
tejas alva
tejas alva on 13 Sep 2018
Commented: Eric Sargent on 22 May 2020
How can i display the figure i select from the folder in UI figure of App designer? I am using version 2016a and as per the code below, when i click the "button", the image opens in a different window.
% Button button pushed function
function ButtonButtonPushed2(app)
[file,path]=uigetfile({'*.jpg';'*.bmp';'*.gif';'*.tiff'}, 'Select file');
a= imread(file);
imshow(a);

Accepted Answer

OCDER
OCDER on 13 Sep 2018
Try this:
imshow(a, 'parent', app.UIAxes);
But, you'll run into issues with having all this x, y, title of axes still shown and taking up space. See this post to fix that issue:
  13 Comments
Eric Sargent
Eric Sargent on 22 May 2020
Starting in R2019a, you can use the uiimage function to create an image component in your App Designer apps.

Sign in to comment.

More Answers (1)

Melinda Toth-Zubairi
Melinda Toth-Zubairi on 12 Jun 2019
Starting in R2019a, you can use the uiimage function to create an image component in your App Designer apps. See here for more details:

Community Treasure Hunt

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

Start Hunting!