Opening and Handling Devices: Open Multiple Devices

This source code sample illustrates how to simultaneously open two devices and display their live video streams on screen.
Language:Visual Basic 6
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 resulting application looks as follows:

The dialog window of the sample application.

When the "Open Device 1..." button is clicked, the application stops the image data stream (.LiveStop). Then, .ShowDeviceSettingsDialog activates a built-in dialog that allows a device to be selected. This device's live image data stream is then displayed using .LiveStart:

Private Sub btnOpenDevice1_Click()

    If ICImagingControl1.LiveVideoRunning Then
        ICImagingControl1.LiveStop
    End If

    ICImagingControl1.ShowDeviceSettingsDialog

    If ICImagingControl1.DeviceValid Then
        ICImagingControl1.LiveStart
    End If

End Sub

To simultaneously start a second live video stream, another IC Imaging Control should be dragged onto the dialog, as is illustrated below.

Private Sub btnOpenDevice2_Click()

    If ICImagingControl2.LiveVideoRunning Then
        ICImagingControl2.LiveStop
    End If

    ICImagingControl2.ShowDeviceSettingsDialog

    If ICImagingControl2.DeviceValid Then
        ICImagingControl2.LiveStart
    End If

End Sub

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.