how can i get screenshot continuously by pressing key?
2 次查看(过去 30 天)
显示 更早的评论
This is my program that I can take a screenshot only once.
i want to take screenshot continuously in video by pressing key.
Can I do this by adding an index?
thanks before.
a = imaqhwinfo;
vid = videoinput('winvideo',1);
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 5;
start(vid)
while(vid.FramesAcquired<=200)
Key=get(gcf,'CurrentKey');
if Key =='s'
img1 = getsnapshot(vid);
break;
end
2 个评论
回答(1 个)
KSSV
2020-9-7
a = imaqhwinfo;
vid = videoinput('winvideo',1);
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 5;
start(vid)
while(vid.FramesAcquired<=200)
Key=get(gcf,'CurrentKey');
if strcmp(Key,'s')
img1 = getsnapshot(vid);
end
end
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!