How to display an image within the figure in App Designer?

9 views (last 30 days)
Salad Box
Salad Box on 17 Nov 2021
Commented: Salad Box on 18 Nov 2021
Hi,
I used to work with GUI and I am very new to the 'App Designer'. As you can see here I have created an interface.
I am hoping to click on the top button 'load your image', select an image in the file, then display it in the 'image' area. I don't know how to achieve this.
Please can anyone give me some advices? :)

Accepted Answer

Yongjian Feng
Yongjian Feng on 17 Nov 2021
Edited: Yongjian Feng on 17 Nov 2021
Try this in your callback:
[file, path] = uigetfile({'*.png'; '*.jpg'}, 'Select file');
app.Image.ImageSource = [path file];
  1 Comment
Salad Box
Salad Box on 18 Nov 2021
That is super helpful and works perfectly! Thank you so much!!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!