请问如何使得程序的子GUI调整参数的时候,主GUI实时更新图像,并且主GUI不会变成当前窗口??我尝试了用定时器,但是有个问题无法解决:当我的主GUI的定时器执行“imshow(Img)”时,该图片会显示到我的子GUI 中,似乎当我从主GUI中打开子GUI 时,我所能获取的figure的handles只能是子GUI的figure。
以下是我的一个测试程序:
主GUI的程序如下:
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Img
global isIMGCHANGE
[FileName,PathName]=uigetfile({'*.bmp'},'Open an Image');
ImgFilePath=fullfile(PathName,FileName);
handles.ImgFilePath=ImgFilePath;
Img=imread(ImgFilePath);
axes(handles.axes1);
imshow(Img);
isIMGCHANGE=0;
t=timer('Period',0.04,'Timer