首先看看效果
首先功能说明下,运行后通过myfile菜单打开一幅图片之后在axes中显示,由于要使用图片的放大缩小等功能将figure 的菜单栏与工具栏都一并打开了。
界面编程主要是callback函数编写,不多说了直接上代码
function varargout = mytest(varargin)
% MYTEST M-file for mytest.fig
% MYTEST, by itself, creates a new MYTEST or raises the existing
% singleton*.
%
% H = MYTEST returns the handle to a new MYTEST or the handle to
% the existing singleton*.
%
% MYTEST('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MYTEST.M with the given input arguments.
%
% MYTEST('Property','Value',...) creates a new MYTEST or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before mytest_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are pas