Is there any way i can place images of colormaps into my popup menu? for example the option colormap_0 (image)
2 views (last 30 days)
Show older comments
function Colormap_Callback(hObject, eventdata, handles)
colormap = get(hObject,'Value');
AFMimage = handles.AFM_BAdjust;
A = AFMimage;
[matrix1,map] = gray2ind(A,256);
switch colormap
case 1
load colormap_0.mat
case 2
load colormap_1.mat
case 3
load colormap_2.mat
case 4
load colormap_3.mat
case 5
load colormap_4.mat
case 6
load colormap_5.mat
case 7
load colormap_6.mat
case 8
load colormap_7.mat
case 9
load colormap_8.mat
case 10
load colormap_9.mat
case 11
load colormap_10.mat
case 12
load colormap_11.mat
case 13
load colormap_12.mat
case 14
load colormap_13.mat
case 15
load colormap_14.mat
case 16
load colormap_15.mat
case 17
load colormap_16.mat
case 18
load colormap_17.mat
case 19
load colormap_18.mat
case 20
load colormap_19.mat
case 21
load colormap_20.mat
otherwise
load colormap_21.mat
end
axes(handles.axes2);imshow(matrix1,map);
axes(handles.axes4);imhist(matrix1,map);
handles.matrix1 = matrix1;
handles.map = map;
% Update handles structure
guidata(hObject, handles);
0 Comments
Answers (2)
Image Analyst
on 15 Jan 2014
I don't think there's anything built in. Your best bet is to see if Yair has some undocumented way of embedding images into a popup/dropdown control. http://undocumentedmatlab.com/
0 Comments
Walter Roberson
on 15 Jan 2014
h = uicontrol('Style', 'popup', 'String', {'Option 1', '<HTML>Option 2 <IMAGE SRC="http://www.mathworks.co.uk/matlabcentral/profiles/1343420.jpg">', 'Option 3'})
0 Comments
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!