做一个保存按钮,Tag是“save”
callback函数如下
% --- Executes on button press in save.
function save_Callback(hObject, eventdata, handles)
% hObject handle to save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uiputfile({'*.bmp';'*.jpg';'*.png'}, 'Pick an image-file');
if isequal(filename,0) || isequal(pathname,0)
disp('User pressed cancel')
return
else
disp(['User selected ', fullfile(pathname, filename)])
end
imwrite(handles.tempimg,[pathname filename]);%%你要保存的图像的axes名称
guidata(hObject, handles);