User`s guide

2 Introduction
% Create a video input object .
vid = videoinput('winv ideo');
% Create a figure window. Thi s ex ampl e tu rns off the default
% toolbar, menubar, and fi gur e nu mber ing.
figure('Toolbar','none',...
'Menubar', 'none', ...
'NumberTitle','Off',...
'Name','My Preview Win dow');
% Create the image object in which you want to display
% the video preview data. Mak e th e size of the image
% object match the dimensi ons of the video frames.
vidRes = get(vid, 'VideoResolution');
nBands = get(vid, 'NumberOfBands');
hImage = image( zeros(vidRes(2), vidRes(1 ), nBands) );
% Display the video data in your GUI.
preview(vid, hImag e);
When y ou run this example, it creates th e GUI shown in the following figure.
Custom Preview
2-12