在MATLAB中,我做了一个GUI,但是从文件夹打开和从MATLAB命令框打开显示的不一样。
我发现如果从文件夹中直接打开的.fig没有把我在openingfcn也就是这个函数functionstart_OpeningFcn(hObject,eventdata,h...
我发现如果从文件夹中直接打开的.fig没有把我在openingfcn也就是这个函数function start_OpeningFcn(hObject, eventdata, handles, varargin)中创建的控件显示出来,我这个例子中是添加一个背景图案,两种途径打开的效果图如图所示。
我的function start_OpeningFcn(hObject, eventdata, handles, varargin)函数如下
function start_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to start (see VARARGIN)
% Choose default command line output for starthandles.output = hObject;
% Update handles structureguidata(hObject, handles);
ha=axes('units','normalized','position',[0 0 1 1]);uistack(ha,'down')II=imread('hexiehao.jpg');image(II)colormap grayset(ha,'visible','off');
请大神指教,怎么写才能够让从文件夹打开的.fig也能显示出
function start_OpeningFcn(hObject, eventdata, handles, varargin)函数中的
背景图案或者其他的控件 展开
我的function start_OpeningFcn(hObject, eventdata, handles, varargin)函数如下
function start_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to start (see VARARGIN)
% Choose default command line output for starthandles.output = hObject;
% Update handles structureguidata(hObject, handles);
ha=axes('units','normalized','position',[0 0 1 1]);uistack(ha,'down')II=imread('hexiehao.jpg');image(II)colormap grayset(ha,'visible','off');
请大神指教,怎么写才能够让从文件夹打开的.fig也能显示出
function start_OpeningFcn(hObject, eventdata, handles, varargin)函数中的
背景图案或者其他的控件 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询