How to make a push button to display an image.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to create a GUI that have 2 push button, 2 axes to display images. the first push button (pb_load) is to load an image and display it in axes1.
if true
[filename pathname] = uigetfile ({'*.jpg';'*.bmp';'*.gif'}, 'Pick an Image');
myImage=strcat(pathname,filename);
axes(handles.axis1);
imshow(myImage);
set(handles.axis1,'visible','off');
guidata(hObject, handles);
end
the second push button is to change the image into R image and display it in axes2.
I do not know the coding that I can use for the push button 2. I also want the axes do not show x-axis and y-axis. But i do not know how.
0 comentarios
Respuestas (1)
Walter Roberson
el 9 de Mayo de 2015
imagehandle = findobj(axes(handles.axis1),'type','image');
imagedata = get(imagehandle, 'CData');
newimagedata = 255 - imagedata; %some transformation since I do not know what "R image" means
newimagehandle = imshow(newimagedata, 'Parent', handles.axes2);
set(handles.axes2, 'Visible', 'off');
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!