%原来我在OpeningFcn进行了
%窗口背景设置
ha=axes('units','normalized','position',[0,0,1,1]);
axis off
uistack(ha,'down')
BJ=imread('bj.jpg');
image(BJ);
colormap gray
set(ha,'handlevisibility','off','visible','off')
%然后在editbox的‘Enable’属性设为‘inactive’,添加buttondownfcn 进行
%设置输入清空(没有背景时可以实现输入清空)
set(hObject,‘String’,'','Enalbe','on');
uicontrol(hObject);
%结果变得无法输入怎么点都没反应,问题是怎么让两个功能共存???或有没有其他设置gui背景的方法??请各位高手帮忙解答, 3Q !
imshow产生的图片对象会捕获Mouse Click事件,要把其HitTest属性设置为off。
Response to captured mouse clicks, specified as one of these values:因此代码修改如下:
image(BJ);