save_image.m

来自「matlab处理图像的一些基本方法。其中有一部分mex程序需要安装编译」· M 代码 · 共 66 行

M
66 行
字号
function k=save_image(filename)%SAVE_IMAGE Save the image in the file FullFname%%    COUNTS = SAVE_IMAGE(FILENAME)%%    If filename is empty ask for the file name.%    Return the same as nano3write%    This function is used from the menu save command.%%    See Also: AFMWRITE%%    Claudio May 30, 1995%%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu,    mark@alice.uoregon.edu%global H I readpath Fname FullFname isModifyif nargin == 0  filename='';endwhile 1  if isempty(filename)    [name, p]=uigetfile([readpath '*']);    if isempty(name) |  name == 0      return;    end    filename = [p name];  end  if exist(filename)==2 & nargin==0    r=alexdlg(['|File: ' filename '||  already exist.||                  Overwrite it?']);    if strcmp(r, 'Cancel'), return;end    if strcmp(r, 'Yes'), break;end	filename='';  else    break;  endend  Fname=name;FullFname=filename;f=watchon;statusbar(['Saving image in: ' filename]);[c, errmsg] = nano3write(filename, H, height2ind(H, I));watchoff(f);clearstatusbar;if isempty(errmsg)  imagetitle;  isModify=0;else  alexerror([filename '|' errmsg]);endif nargout ~= 0  k=c;endreturn

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?