i want to design a GUI interface with a push button and when i click on the button it opens a pop window to insert a picture from my pc

1 visualización (últimos 30 días)
i want to design a GUI interface with a push button and when i click on the button it opens a pop window to insert a picture from my pc

Respuestas (1)

Daniel
Daniel el 22 de Ag. de 2016
Editada: Daniel el 22 de Ag. de 2016
Here's one way of doing something similar to what you're asking.
function getImageExample
clf(gcf)
ax = gca;
uicontrol('style','pushbutton','string','add image','callback',@addImage);
function addImage(varargin)
[f,p] = uigetfile('*.png','Select Image','Multiselect','off');
if ~ischar(f),return,end
imshow(fullfile(p,f),'parent',ax)
end
end

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by