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
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
Daniel
2016 年 8 月 22 日
編集済み: Daniel
2016 年 8 月 22 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!