How to add an image component to a gui (not an axes component)
Afficher commentaires plus anciens
Hi all, I need to add an image to a gui. currently I do it by declaring an axes component, and then making an image out of it:
[PicName, PicPath, FilterInd] = uigetfile('.././*.jpg');
handles.Pic = imread ( strcat(PicPath, PicName));
handles.PathToComparedPic = PicPath;
handles.axes1 = image(handles.Pic);
guidata(hObject,handles);
However I get some ugly x and y axes. I tried to shut them off bu didn't succeed. Is there a way to declare an image component? alternatively is there a way to make the x-y axes go away?
Thanks for the help!
Réponses (1)
Walter Roberson
le 31 Mai 2011
images must be the children of an axes (or hggroup or hggroup that are children of an axes.)
You have
handles.axis1 = image(handles.Pic)
but image() returns the handle to an image object, not the handle to the axes.
set(gca,'Visible','off')
Catégories
En savoir plus sur Display Image dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!