Load an image which i choose from a spesific folder
9 ビュー (過去 30 日間)
古いコメントを表示
I'm building a GUI in which i have a button that i want to load an image from specific folder.But i don't want a specific image.I want to have the choise to choose one image that i want(not multiple images just one).Is there any way to push that button open me the folder and choose my image? Images files must be (.bmp) Thanks a lot
0 件のコメント
採用された回答
Bego
2016 年 9 月 16 日
編集済み: Bego
2016 年 9 月 16 日
Hello Thanos!
In your GUI add a EditText (Tag edit1) and a Push button (Tag pushbutton1). Right click over the push button and select View Callbacks/Callback. On the pushbutton1_Callback write something like this:
%Open dialog box and select and image from it
[filename,filepath]=uigetfile({'*.bmp'},'Select and image');
%Set the value of the text field edit1 to the route of the selected image.
set(handles.edit1, 'String', strcat(filepath, filename));
You can read more information at: http://es.mathworks.com/help/matlab/ref/uigetfile.html?searchHighlight=uigetfile
Regards,
その他の回答 (1 件)
PRAJWAL GOWDA HM
2019 年 7 月 13 日
[filename,filepath]=uigetfile({'*.bmp'},'Select and image');
selectedImage = imread(strcat(filepath, filename));
imshow(selectedImage);
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!