Call a folder from desktop and use images inside it
    12 次查看(过去 30 天)
  
       显示 更早的评论
    
I want to make a programme where i can call a file from desktop and them use images stored in it in the same programme.
0 个评论
采纳的回答
  Wan Ji
      
 2021-11-29
        Hey, friend,
Using uigetfile is a nice choice, for example
[file,path,indx] = uigetfile( ...
{'*.jpg;*.png;*.tiff;*.tif;*.bmp',...
    'Image Files (*.jpg;*.png;*.tiff;*.tif;*.bmp)'; ...
    '*.*','All Files (*.*)'}, ...
   'Select a File');
% Then use imread to read the image
I = imread([path, file]);
0 个评论
更多回答(1 个)
  yanqi liu
      
 2021-11-30
        % read
[filename, pathname, ~] = uigetfile( ...
    { '*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';...
    '*.*',  'all files (*.*)'}, ...
    'choose file', ...
    'MultiSelect', 'off', ...
    'C:\Users\Administrator\Desktop\');
filePath = 0;
if isequal(filename, 0) || isequal(pathname, 0)
    return;
end
filePath = fullfile(pathname, filename)
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
			
	产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


