Effacer les filtres
Effacer les filtres

drawout question

2 vues (au cours des 30 derniers jours)
Cindy
Cindy le 21 Mar 2012
After why the program code does run, still will present busy. Maybe will be the drawout question, ask that had any method to be possible to solve this problem,or had the any program code could substitute for drawout .
This is my program code: function f4() clear all;
obj1 = mmreader('can.avi'); obj2 = mmreader('watch.avi'); obj3 = mmreader('book.avi'); obj4 = mmreader('phone.avi');
vid1 = read(obj1); vid2 = read(obj2); vid3 = read(obj3); vid4 = read(obj4);
frame1 = 1; frame2 = 50; frame3 = 30; frame4 = 1; f4 = 1;
hst1=0; hst2=0; hst3=0; hst4=0;
h = figure('Name','Video ', 'NumberTitle','off','Color',[1,1,1],'Toolbar','none','Visible','on', 'Position',[80 40 1150 700],... 'Resize','off','menu','none');
hstat1 = uicontrol('unit','pixel','style','checkbox','value',0,'position',... [50 630 25 25],'units','normalized'); hstat2 = uicontrol('unit','pixel','style','checkbox','value',0,'position',... [50 550 25 25],'units','normalized'); hstat3 = uicontrol('unit','pixel','style','checkbox','value',0,'position',... [50 480 25 25],'units','normalized'); hstat4 = uicontrol('unit','pixel','style','checkbox','value',0,'position',... [50 410 25 25],'units','normalized');
hplay1 = uicontrol('unit','pixel','style','pushbutton','string','藥罐_PLAY',... 'position',[50 630 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play1_callback}); hplay2 = uicontrol('unit','pixel','style','pushbutton','string','手錶_PLAY',... 'position',[50 550 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play2_callback}); hplay3 = uicontrol('unit','pixel','style','pushbutton','string','書本_PLAY',... 'position',[50 480 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play3_callback}); hplay4 = uicontrol('unit','pixel','style','pushbutton','string','手機_PLAY',... 'position',[50 410 70 40],'backgroundColor',[0.3,0.7,1],'units','normalized','callback',{@play4_callback});
hstop1 = uicontrol('unit','pixel','style','pushbutton','string','藥罐_STOP',... 'position',[50 330 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',@stop1_callback); hstop2 = uicontrol('unit','pixel','style','pushbutton','string','手錶_STOP',... 'position',[50 250 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',@stop2_callback); hstop3 = uicontrol('unit','pixel','style','pushbutton','string','書本_STOP',... 'position',[50 170 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',@stop3_callback); hstop4 = uicontrol('unit','pixel','style','pushbutton','string','手機_STOP',... 'position',[50 90 70 40],'backgroundColor',[0.2,1,0],'units','normalized','callback',@stop4_callback);
hexit = uicontrol('unit','pixel','style','pushbutton','string','EXIT',... 'position',[50 10 70 40],'backgroundColor',[1,0,0],'units','normalized','callback',@exit_callback);
while (1)
if hst1==1 subplot(2,2,1); imshow(vid1(:,:,:,frame1)); if frame1 < size(vid1,4) frame1 = frame1+1; else frame1 = 1; end
end
if hst2==1 subplot(2,2,2); imshow(vid2(:,:,:,frame2)); if frame2 < size(vid2,4) frame2 = frame2+1; else frame2 = 1; end end
if hst3==1 subplot(2,2,3); imshow(vid3(:,:,:,frame3)); if frame3 < size(vid3,4) frame3 = frame3+1; else frame3 = 1; end end
if hst4==1 subplot(2,2,4); imshow(vid4(:,:,:,frame4)); if frame4 < size(vid4,4) frame4 = frame4+1; else frame4 = 1; end % else % subplot(2,2,4); imshow(vid2(:,:,:,1)); end
drawnow; if f4 ==10000 break; % else f4 = f4+1; end end
function play1_callback(hObject0,eventdata0) set(hstat1,'value',1); hst1=1; set(hplay1 ,'backgroundColor',[1,1,0],'string','藥罐_播放中'); %set(gcf,'units','normalized','position',[0 0 1 1]); end
function play2_callback(hObject1,eventdata1) set(hstat2,'value',1); hst2=1; set(hplay2 ,'backgroundColor',[1,1,0],'string','手錶_播放中'); end
function play3_callback(hObject2,eventdata2) set(hstat3,'value',1); hst3=1; set(hplay3 ,'backgroundColor',[1,1,0],'string','書本_播放中'); end
function play4_callback(hObject3,eventdata) set(hstat4,'value',1); hst4=1; set(hplay4 ,'backgroundColor',[1,1,0],'string','手機_播放中'); end
function stop1_callback(hObject,eventdata) set(hstat1,'value',0); hst1=0; set(hplay1 ,'backgroundColor',[0.3,0.7,1],'string','藥罐_PLAY'); end
function stop2_callback(hObject,eventdata) set(hstat2,'value',0); hst2=0; set(hplay2 ,'backgroundColor',[0.3,0.7,1],'string','手錶_PLAY'); end
function stop3_callback(hObject,eventdata) set(hstat3,'value',0); hst3=0; set(hplay3 ,'backgroundColor',[0.3,0.7,1],'string','書本_PLAY'); end
function stop4_callback(hObject,eventdata) set(hstat4,'value',0); hst4=0; set(hplay4 ,'backgroundColor',[0.3,0.7,1],'string','手機_PLAY'); end
function exit_callback(hObject,eventdata)
stop1_callback; stop2_callback; stop3_callback; stop4_callback; f4=1000; close gcf; end
end
Please instruct me, thank you very much!
  2 commentaires
Jan
Jan le 21 Mar 2012
Please format the code as explained in the "Markup help" link.
I do not understand the question. Please rephrase it.
Image Analyst
Image Analyst le 21 Mar 2012
Edit your code. Then highlight all your code and click the "{}Code" icon above the edit box, then re-save your message.

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by