Guide Popupmenu adding an image?
조회 수: 3 (최근 30일)
이전 댓글 표시
How can you add an image to a popupmenu using guide? An example picture of what I am trying to do is shown below. I have been trying to figure this out with no luck. Any help is appreciated.
댓글 수: 0
채택된 답변
추가 답변 (1개)
Jan
2014년 11월 15일
You can include images using HTML:
Icon = fullfile(matlabroot,'/toolbox/matlab/icons/matlabicon.gif');
IconURI = ['"file:/', strrep(Icon, '\', '/'), '"'];
uicontrol('Style', 'popupmenu', ...
'String', {'Hello', ['<html><img src=', IconURI, '> String']})
댓글 수: 4
Image Analyst
2014년 11월 16일
That's not right. Look at the code in comments. What you call contents is actually the index that is selected. To get the contents and index:
selectedIndex = get(handles.popup1, 'Value');
allContents = get(handles.popup1,'string');
selectedContents = allContents{selectedIndex};
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!