フィルターのクリア

put all images of a directory in listbox

3 ビュー (過去 30 日間)
malek el pikho
malek el pikho 2014 年 1 月 20 日
コメント済み: Image Analyst 2014 年 1 月 20 日
how can i put all images of a directory in listbox and then select one of them to do image to show in axes

回答 (2 件)

Walter Roberson
Walter Roberson 2014 年 1 月 20 日
will give you information on getting the image names. Once you have them in a cell string array, you can set() the listbox String property to that cell string array.
In the callback for the listbox,
choices = get(hObject, 'String');
selected = get(hObject, 'Value');
thischoice = choices{selected};

David Sanchez
David Sanchez 2014 年 1 月 20 日
my_pngs = dir('*.png'); % choose png files from directory
pics_cell = cell(numel(my_pngs),1);
for k=1:numel(my_pngs)
pics_cell{k} = my_pngs(k).name;
end
set(handles.my_list,'String',pics_cell) % my_list is the name of your listbox
  8 件のコメント
malek el pikho
malek el pikho 2014 年 1 月 20 日
no no no its done thanks a lot
Image Analyst
Image Analyst 2014 年 1 月 20 日
Then mark it as accepted.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by