|
Open Device Using Dialog This is a brief coding example that illustrates how to open an video capture device using the build in dialog and display the live image data stream using C++.
The sample application's window looks as follows:
First of all the instance of the Grabber class is to be created as member of the dialog class.
DShowLib::Grabber m_cGrabber; // The instance of the Grabber class.
The video capture device will be opened in the CDialog::OnInitDialog() method. With a call to Grabber::showDevicePage() IC Imaging Control's built-in video capture device selection dialog is shown.
If a video capture device has been opened successfully, i.e. it is valid, the image data stream is started by a call to Grabber::startLive(). The source code for this task is implemented as follows:
m_cGrabber.showDevicePage();
if( m_cGrabber.isDevValid())
m_cGrabber.startLive();
|