copyimage.m
来自「matlab处理图像的一些基本方法。其中有一部分mex程序需要安装编译」· M 代码 · 共 41 行
M
41 行
function cimg=copyimage%COPYIMAGE Copy from a specified position in the current image an area, % defined with the mouse, to the global variable CutPaste.%% Claudio 28 Sept. 1995%%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%global H I CutPaste;if nargin>0 error('Too many input arguments.');endif ~isimage setviewmode('TOPVIEW'); showimage;end[qq, rect]=imcrop;ss=scansize(H);px=size(I,1);rect(1)=rect(1)-xoffset(H);rect(2)=rect(2)-yoffset(H);rect=rect*px/ss;rect=round(rect);CutPaste=I(rect(2):rect(2)+rect(4), rect(1):rect(1)+rect(3));set(findobj('tag', 'PASTEITEM'), 'Enable', onoff(~isempty(CutPaste)));if nargout == 1cimg=CutPaste;end return;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?