用MATLAB GUI创建两个按钮 点击按钮打开一段视频 在点击另一个播放视频 求大神指导
展开全部
大概是这样的把
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile( '*.avi', '开始');
readerobj = mmreader([pathname,filename]);
vidFrames = read(readerobj);
numFrames = get(readerobj, 'numberOfFrames');
for k = 1 : numFrames
mov(k).cdata =vidFrames (:,:,:,k);
mov(k).colormap = [];
end
movie(handles.axes1,mov,1,readerobj.FrameRate);
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile( '*.avi', '开始');
readerobj = mmreader([pathname,filename]);
vidFrames = read(readerobj);
numFrames = get(readerobj, 'numberOfFrames');
for k = 1 : numFrames
mov(k).cdata =vidFrames (:,:,:,k);
mov(k).colormap = [];
end
movie(handles.axes1,mov,1,readerobj.FrameRate);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询