?? customimage.m
字號:
function varargout = customImage(varargin)
% CUSTOMIMAGE M-file for customImage.fig
% CUSTOMIMAGE, by itself, creates a new CUSTOMIMAGE or raises the existing
% singleton*.
%
% H = CUSTOMIMAGE returns the handle to a new CUSTOMIMAGE or the handle to
% the existing singleton*.
%
% CUSTOMIMAGE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CUSTOMIMAGE.M with the given input arguments.
%
% CUSTOMIMAGE('Property','Value',...) creates a new CUSTOMIMAGE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before customImage_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to customImage_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help customImage
% Last Modified by GUIDE v2.5 27-Nov-2007 20:03:06
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @customImage_OpeningFcn, ...
'gui_OutputFcn', @customImage_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
%%
% --- Executes just before customImage is made visible.
function customImage_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to customImage (see VARARGIN)
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
%%
% --- Outputs from this function are returned to the command line.
function varargout = customImage_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%%
function slider_editText_Callback(hObject, eventdata, handles)
%get the string for the editText component
sliderValue = get(handles.slider_editText,'String');
%convert from string to number
sliderValue = str2num(sliderValue);
%if user inputs something is not a number, or if the input is less than 0
%or great than 100, then the customImage defaults to 0
if (isempty(sliderValue) || sliderValue < 0 || sliderValue > 100)
set(handles.slider1,'Value',0);
set(handles.slider_editText,'String','0');
else
set(handles.slider1,'Value',sliderValue);
end
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function slider_editText_CreateFcn(hObject, eventdata, handles)
% hObject handle to customImage_editText (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
%%
% --- Executes on customImage movement.
function slider1_Callback(hObject, eventdata, handles)
%obtains the customImage value from the customImage component
sliderValue = get(handles.slider1,'Value');
%puts the customImage value into the edit text component
set(handles.slider_editText,'String', num2str(sliderValue));
guidata(hObject, handles);
%%
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: customImage controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
function pushbutton2_Callback(hObject, eventdata, handles)
function pushbutton1_Callback(hObject, eventdata, handles)
function pushbutton4_Callback(hObject, eventdata, handles)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -