1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| % --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a = 180;
b = str2double(get(handles.edit7, 'String'));
wd = cd();
figureFileName = [wd '\imgProp.fig'];
fig = figure('FileName', figureFileName, 'Name', 'Propriétés des jeux d''images', 'Tag', 'imgProp', 'NumberTitle', 'off', 'MenuBar', 'none', 'Color', [0.925 0.914 0.847], 'Position', [360 502 400 a*b+20]);
movegui(fig,'center')
c = 5;
uicontrol('Style', 'pushbutton', 'Position', [290 c 70 22], 'Tag', 'okTag', 'Callback', @okImages_Callback, 'String', 'Ok', 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
for i = 1:b
j = num2str(i);
string = ['** Set ' j];
setTag = ['setTag' j];
uicontrol('Style', 'text', 'FontSize', 10, 'Position', [20 c+170 100 20], 'HorizontalAlignment', 'left', 'Tag', setTag, 'String', string, 'Parent', fig, 'BackgroundColor', [0.925 0.914 0.847], 'ForegroundColor', [0 0 0]);
% nom du set
uicontrol('Style', 'text', 'FontSize', 10, 'Position', [80 c+170 40 20], 'HorizontalAlignment', 'left', 'String', 'Nom', 'Parent', fig, 'BackgroundColor', [0.925 0.914 0.847], 'ForegroundColor', [0 0 0]);
nomTag = ['nomTag' j];
uicontrol('Style', 'edit', 'String', '', 'Position', [120 c+170 180 20], 'HorizontalAlignment', 'left', 'Tag', nomTag, 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
% Commentaire
uicontrol('Style', 'text', 'FontSize', 8, 'Position', [20 c+115 160 20], 'HorizontalAlignment', 'left', 'String', 'Commentaire (html accepté)', 'Parent', fig, 'BackgroundColor', [0.925 0.914 0.847], 'ForegroundColor', [0 0 0]);
commentTag = ['commentTag' j];
uicontrol('Style', 'edit', 'Min', 1, 'Max', 10, 'String', '', 'Position', [20 c+55 360 60], 'HorizontalAlignment', 'left', 'Tag', commentTag, 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
% Transparence
uicontrol('Style', 'text', 'FontSize', 8, 'Position', [20 c+30 220 20], 'HorizontalAlignment', 'left', 'String', 'Valeurs (R,V,B) du pixel seuil transparence', 'Parent', fig, 'BackgroundColor', [0.925 0.914 0.847], 'ForegroundColor', [0 0 0]);
redTag = ['redTag' j];
uicontrol('Style', 'edit', 'String', '0', 'Position', [240 c+30 40 20], 'HorizontalAlignment', 'center', 'Tag', redTag, 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
greenTag = ['greenTag' j];
uicontrol('Style', 'edit', 'String', '0', 'Position', [280 c+30 40 20], 'HorizontalAlignment', 'center', 'Tag', greenTag, 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
blueTag = ['blueTag' j];
uicontrol('Style', 'edit', 'String', '0', 'Position', [320 c+30 40 20], 'HorizontalAlignment', 'center', 'Tag', blueTag, 'Parent', fig, 'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0]);
c = c+a;
end
saveas(gcf, figureFileName)
% handles = guihandles;
function okImages_Callback(hObject, event, handles)
handles=guihandles(Interface2);
guidata(Interface2, handles);
a = str2double(get(handles.edit7, 'String'));
wd = cd();
figureFileName = [wd '\imgProp.fig'];
h = hgload(figureFileName);
handles=guihandles(h);
guidata(h,handles);
arrayInfoImg = cell(a,4); % 4 colonnes : nom, chemin, commentaire, [r v b]
for i = 1:a
j = num2str(i);
% stocke noms des sets
nomTag = ['nomTag' j];
arrayInfoImg{i,1} = get(handles.(nomTag), 'String'); % ne marche pas, renvoie chaine vide..? le texte tapé n'est pas pris en compte?
% ajouter les autres infos... (nom, commentaire, etc..)
end |
Partager