作者winse (winse)
看板MATLAB
标题Re: [问题] matlab 设计gui时插入背景图档的问题
时间Fri Nov 11 14:32:04 2011
※ 引述《o03213 (小老鼠的天空)》之铭言:
: 小弟目前再设计一个gui
: 目前我可以用gui按钮控制视讯的开关,但我希望指令叫出来的视讯视窗
: 可以在我设计的gui里面希望可以放在一起,但是不知道怎麽做
: 顺便问一下,想要再gui背景放入图档比较美观
: 但是找不到关於放置图档的属性
: 该怎麽做尼???感谢各位大大感激不尽
刚好在其他地方看到,顺便回一下文
Write following code in the CreateFcn of your GUI.
% ===================================================
% This creates the 'background' axes
ha = axes('units','normalized', ...
'position',[0 0 1 1]);
% Move the background axes to the bottom
uistack(ha,'bottom');
% Load in a background image and display it using the correct colors
% The image used below, is in the Image Processing Toolbox.
% If you do not have
% access to this toolbox, you can use another image file instead.
I=imread('eight.tif');
hi = imagesc(I)
colormap gray
% Turn the handlevisibility off so that we don't inadvertently plot into the
% axes again
% Also, make the axes invisible
set(ha,'handlevisibility','off', ...
'visible','off')
% Now we can use the figure, as required.
% For example, we can put a plot in an axes
axes('position',[0.3,0.35,0.4,0.4])
plot(rand(10))
% Or you can arrange this you gui objects.
% ==========================================================
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.76.107