gusucode.com > Matlab精彩编程100例源码程序 > Matlab精彩编程100例源码/work/shili76.m
h0=figure('toolbar','none',... 'position',[198 56 500 500],... 'name','实例76'); h1=axes('parent',h0,... 'position',[0.15 0.5 0.7 0.5],... 'visible','off'); u1=uimenu('parent',h0,... 'label','加载图像',... 'backgroundcolor',[0.753 0.753 0.753],... 'tag','u1',... 'callback',[... '[X,map]=imread(''800.jpg'',''jpg'');,',... 'Y=imresize(X,2);,',... 'image(Y),',... 'colormap(map),',... 'axis image,',... 'camva(camva/2.5),',... 'disp(''单击鼠标左键点取需要的点''),',... 'disp(''单击鼠标右键确定最后一个点''),',... 'while 1,',... '[x,y]=ginput(1);,',... 'if ~strcmp(get(gcf,''selectiontype''),''normal''),',... 'break,',... 'end,',... 'ct=camtarget;,',... 'dx=x-ct(1);,',... 'dy=y-ct(2);,',... 'camdolly(dx,dy,ct(3),''movetarget'',''data''),',... 'drawnow,',... 'end']); u2=uimenu('parent',h0,... 'label','关闭',... 'backgroundcolor',[0.753 0.753 0.753],... 'tag','u2',... 'callback','close');