How to add an image component to a gui (not an axes component)

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!

Answers (1)

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')

Categories

Find more on Display Image in Help Center and File Exchange

Asked:

roi
on 31 May 2011

Community Treasure Hunt

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

Start Hunting!