MatLab GUI - Image

Fermé
CwisCH Messages postés 1 Date d'inscription lundi 18 mai 2009 Statut Membre Dernière intervention 18 mai 2009 - 18 mai 2009 à 16:18
Bonjour,

Je fais mon projet de diplôme sur le traitement d'image en MatLab. J'ai une très bonne connaissance de MatLab mais alors absolument pas de son GUI.

J'ai créé une fenêtre qui contient trois boutons. Lorsque ces boutons sont pressés, ils activent les bonnes fonctions.
Maintenant j'aimerais afficher une image au milieu de la fenêtre. Cette image est choisie lorsqu'on appuie sur un des boutons.
J'ai essayé plusieurs choses mais rien ne fonctionne. L'image ne s'affiche pas!

Pourriez-vous m'aider s'il vous plaît?

Merci d'avance!

PS: Le code source ci dessous:
function GUI_user
% GUI_user : %
% - select the picture and the reference file to use %
% - start the CheckMedic algorithm %
% - display the result %

% Initialise and hide the GUI figure %
f = figure('Visible','off',...
'Position',[200,200,500,300],...
'name', 'user @ CheckMedic');

% Buttons %
b_img = uicontrol('Style','pushbutton',...
'String','Image','Position',[50,250,70,25],...
'Callback',{@choixImg});
b_ref = uicontrol('Style','pushbutton',...
'String','Référence','Position',[50,150,70,25],...
'Callback',{@choixRef});
b_start = uicontrol('Style','pushbutton',...
'String','START','Position',[400,250,70,25],...
'Callback',{@choixDep});

% Image %
handles.pict = imread('E:\School\HES 3\Diplôme\04 - Fonctions\00 - imgs\flacon01 (2).JPG');
hPlotAxes = axes('Position',[100 50 100 100]);
imshow(handles.pict);

% Texts %
% Align the components.
align([b_img,b_ref],'Center','None');

% Change units to normalized so components resize automatically.
set([f,b_img,b_ref,b_start,hPlotAxes],'Units','normalized');

% Assign the GUI a name to appear in the window title.
set(f,'Name','Simple GUI')

% Move the GUI to the center of the screen.
movegui(f,'center')

% Make the GUI visible.
set(f,'Visible','on');