gusucode.com > Matlab精彩编程100例源码程序 > Matlab精彩编程100例源码/实例84/实例84.m

    h0=figure('toolbar','none',...
    'position',[198 56 400 468],...
    'name','实例84');
h1=axes('parent',h0,...
    'position',[0.25 0.45 0.5 0.5],...
    'visible','off');
I=imread('plane.jpg','jpg');
imshow(I)
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'style','pushbutton',...
    'string','图像旋转',...
    'position',[200 120 50 20],...
    'callback',[...
        'cla,',...
        'k=str2num(get(e1,''string''));,',...
        'I=imread(''plane.jpg'',''jpg'');,',...
        'J=imrotate(I,k,''bilinear'');,',...
        'imshow(J)']);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'style','pushbutton',...
    'string','图像剪切',...
    'position',[200 80 50 20],...
    'callback',[...
        'cla,',...
        'imshow plane.jpg,',...
        'I=imcrop;,',...
        'imshow(I)']);
  b3=uicontrol('parent',h0,...
    'units','points',...
    'tag','b3',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'style','pushbutton',...
    'string','关闭',...
    'position',[120 30 50 20],...
    'callback','close');
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'style','edit',...
    'horizontalalignment','right',...
    'position',[50 80 100 20]);
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'style','text',...
    'string','请输入旋转角度(0~90)度',...
    'fontsize',12,...
    'position',[40 100 130 20]);