Opening and Handling Devices: Open a Video Capture Device

This is a brief coding example that illustrates how to open an video capture device and display the live image data stream using vc71.
Language:Visual C++
Version:3.0.3
Released on:April 7, 2005
Author:IC Imaging Control Support Department
Requirements:IC Imaging Control >2.1
Camera, converter or grabber with WDM Stream Class drivers.

The sample application's window looks as follows:

The dialog window of the sample application.

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. Its device name string, e.g. "DBK 21F04" is passed to Grabber::openDev(). If the video capture device has been opened successfully, i.e. it is valid, the image data stream is started by a call to Grabber::startLive().

m_cGrabber.openDev( "DBK 21F04" );

if( m_cGrabber.isDevValid())
        m_cGrabber.startLive();

Related Source Code Samples

Disclaimer
The source code that appears in the IC Imaging Control Source Code Library is indented for educational purposes only. The Imaging Source Europe GmbH, the manufacturer of IC Imaging Control, does not assume any kind of warranty expressed or implied, resulting from the use of the content of this page.

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, LiveDocx, phpLiveDocx and Forums.