How to display image information using a pushbutton in GUI ?
Afficher commentaires plus anciens
CODE :
function Display_Information_Callback(hObject, eventdata, handles)
% hObject handle to Display_Information (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename pathname]=uigetfile({' *.jpg';'*.png'},'File Select');
image=strcat(pathname,filename);
[pathstr,name ,ext ,versn]=fileparts(filename);
fileinfo=imfinfo(image);
FileSize1=fileinfo.FileSize(1,1);
sizew=fileinfo.Width(1,1);
sizeh=fileinfo.Height(1,1);
axes(handles.axes2)
imshow(image)
set(handles.edit5,'string',name);
set(handles.edit7,'string',sizew);
set(handles.edit8,'string',sizeh);
set(handles.edit6,'string',FileSize1);
set(handles.edit9,'string',ext);
set(handles.edit11,'string',image);
GUI Designed :

ERROR :
Error using
fileparts
Too many
output
arguments.
Error in
userspecified>Display_Information_Callback
(line 160)
[pathstr,name
,ext
,versn]=fileparts(filename);
Error in
gui_mainfcn
(line 95)
feval(varargin{:});
Error in
userspecified
(line 42)
gui_mainfcn(gui_State,
varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)userspecified('Display_Information_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur System Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
