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!