Azzera filtri
Azzera filtri

how to use image(sc) in Application Designer (appDesigner)?

31 visualizzazioni (ultimi 30 giorni)
how to use image/imagesc in Application Designer?

Risposte (2)

Sindhu Yerragunta
Sindhu Yerragunta il 18 Giu 2018

Kevin Chng
Kevin Chng il 31 Ago 2018
Modificato: Kevin Chng il 31 Ago 2018
Hi,
In my practice, i use axes to host image. App designer don't allow you to modify the generated GUI code except call back. Therefore,
1) Design your GUI in app designer, drag a axes on the GUI.
2) Then, you copy the whole code then paste it in the .m file in your matlab.
3) name the .m file properly, at the first row of script, you will see this "classdef app1 < matlab.apps.AppBase", please ensure the name of your .m file is also app1. If you want to name them other than app1, we may discuss further.
4) find this in your script,
function createComponents(app)
.....
....
app.UIAxes = uiaxes(app.UIFigure);
app.UIAxes.Position = [52 313 560 99];
imshow('Picture1.png','Parent',app.UIAxes);
......
......
Add the imshow below the app.UIAxes. 5) Done. The limitation of this method is you can't compile it through web apps compiler. However, it don't have any issue with MATLAB compiler.
2nd Method is use Button to host your image.
1) In your app designer, you drag the button in your GUI.
2) Double click on your button, then you try to find more properties in your button properties on the bottom left of your screen.
3) click on more properties, then you will see Icon File.
4) Select the image you wanted to insert, then delete the text/words of button.
5) Done

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by