How to add an image component to a gui (not an axes component)
Mostrar comentarios más antiguos
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!
Respuestas (1)
Walter Roberson
el 31 de Mayo de 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')
Categorías
Más información sobre Display Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!