SaveImgs(GUI) A GUI tool for SaveFlxImgs getting the user defined information (format,resolution,...) for exporting images created by NetDraw|KeggDraw O. Jamialahmadi TMU, Chem. Eng. Dept., Biotech. Group June 2016
0001 function varargout = SaveImgs(varargin) 0002 % SaveImgs(GUI) 0003 % A GUI tool for SaveFlxImgs getting the user defined information 0004 %(format,resolution,...) for exporting images created by NetDraw|KeggDraw 0005 % 0006 % O. Jamialahmadi 0007 % TMU, Chem. Eng. Dept., Biotech. Group 0008 % June 2016 0009 0010 % Begin initialization code - DO NOT EDIT 0011 gui_Singleton = 1; 0012 gui_State = struct('gui_Name', mfilename, ... 0013 'gui_Singleton', gui_Singleton, ... 0014 'gui_OpeningFcn', @SaveImgs_OpeningFcn, ... 0015 'gui_OutputFcn', @SaveImgs_OutputFcn, ... 0016 'gui_LayoutFcn', [] , ... 0017 'gui_Callback', []); 0018 if nargin && ischar(varargin{1}) 0019 gui_State.gui_Callback = str2func(varargin{1}); 0020 end 0021 0022 if nargout 0023 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0024 else 0025 gui_mainfcn(gui_State, varargin{:}); 0026 end 0027 % End initialization code - DO NOT EDIT 0028 0029 0030 % --- Executes just before SaveImgs is made visible. 0031 function SaveImgs_OpeningFcn(hObject, eventdata, handles, varargin) 0032 % This function has no output args, see OutputFcn. 0033 % hObject handle to figure 0034 % eventdata reserved - to be defined in a future version of MATLAB 0035 % handles structure with handles and user data (see GUIDATA) 0036 % varargin command line arguments to SaveImgs (see VARARGIN) 0037 set(handles.ImgResPopupmenu,'String',{'300','350','400','450',... 0038 '500','550','600','1200'}); 0039 set(handles.ImgFormatPopupmenu,'String',{'PNG','JPEG','BMP',... 0040 'TIFF','PDF'}); 0041 % Choose default command line output for SaveImgs 0042 handles.output = hObject; 0043 0044 % Update handles structure 0045 guidata(hObject, handles); 0046 0047 % UIWAIT makes SaveImgs wait for user response (see UIRESUME) 0048 % uiwait(handles.figure1); 0049 0050 0051 % --- Outputs from this function are returned to the command line. 0052 function varargout = SaveImgs_OutputFcn(hObject, eventdata, handles) 0053 % varargout cell array for returning output args (see VARARGOUT); 0054 % hObject handle to figure 0055 % eventdata reserved - to be defined in a future version of MATLAB 0056 % handles structure with handles and user data (see GUIDATA) 0057 0058 % Get default command line output from handles structure 0059 varargout{1} = handles.output; 0060 0061 0062 % --- Executes on selection change in ImgResPopupmenu. 0063 function ImgResPopupmenu_Callback(hObject, eventdata, handles) 0064 % hObject handle to ImgResPopupmenu (see GCBO) 0065 % eventdata reserved - to be defined in a future version of MATLAB 0066 % handles structure with handles and user data (see GUIDATA) 0067 0068 % Hints: contents = cellstr(get(hObject,'String')) returns ImgResPopupmenu contents as cell array 0069 % contents{get(hObject,'Value')} returns selected item from ImgResPopupmenu 0070 0071 0072 % --- Executes during object creation, after setting all properties. 0073 function ImgResPopupmenu_CreateFcn(hObject, eventdata, handles) 0074 % hObject handle to ImgResPopupmenu (see GCBO) 0075 % eventdata reserved - to be defined in a future version of MATLAB 0076 % handles empty - handles not created until after all CreateFcns called 0077 0078 % Hint: popupmenu controls usually have a white background on Windows. 0079 % See ISPC and COMPUTER. 0080 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0081 set(hObject,'BackgroundColor','white'); 0082 end 0083 0084 0085 % --- Executes on selection change in ImgFormatPopupmenu. 0086 function ImgFormatPopupmenu_Callback(hObject, eventdata, handles) 0087 % hObject handle to ImgFormatPopupmenu (see GCBO) 0088 % eventdata reserved - to be defined in a future version of MATLAB 0089 % handles structure with handles and user data (see GUIDATA) 0090 0091 % Hints: contents = cellstr(get(hObject,'String')) returns ImgFormatPopupmenu contents as cell array 0092 % contents{get(hObject,'Value')} returns selected item from ImgFormatPopupmenu 0093 0094 0095 % --- Executes during object creation, after setting all properties. 0096 function ImgFormatPopupmenu_CreateFcn(hObject, eventdata, handles) 0097 % hObject handle to ImgFormatPopupmenu (see GCBO) 0098 % eventdata reserved - to be defined in a future version of MATLAB 0099 % handles empty - handles not created until after all CreateFcns called 0100 0101 % Hint: popupmenu controls usually have a white background on Windows. 0102 % See ISPC and COMPUTER. 0103 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0104 set(hObject,'BackgroundColor','white'); 0105 end 0106 0107 0108 % --- Executes on button press in Donepushbutton1. 0109 function Donepushbutton1_Callback(hObject, eventdata, handles) 0110 % hObject handle to Donepushbutton1 (see GCBO) 0111 % eventdata reserved - to be defined in a future version of MATLAB 0112 % handles structure with handles and user data (see GUIDATA) 0113 ImgFrmt=get(handles.ImgFormatPopupmenu,'Value'); 0114 setappdata(0,'ImgFrmt',ImgFrmt); 0115 ImgRes=get(handles.ImgResPopupmenu,'Value'); 0116 setappdata(0,'ImgRes',ImgRes); 0117 close(gcf)