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!
답변 (1개)
Walter Roberson
2011년 5월 31일
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')
카테고리
도움말 센터 및 File Exchange에서 Display Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!