IC Imaging Control ActiveX

ICImagingControl.Devices Property

ICImagingControl.Devices Property

Returns a collection of all available video capture devices.
Public Devices As Devices

Run time only, read only.


This example displays all available video capture devices in a combo box. If no video capture devices are installed, the text "no devices found" will be displayed in the combo box. In this case the combo box will be disabled. The combo box for the video capture devices is named "cboVideoSource" in this example.

Private Sub UpdateDevices()
    Dim Name As String
    Dim DeviceCollection As Devices
    Dim Item As Variant
    Dim Idx As Long
    Idx = -1
    Set DeviceCollection = ImagingControl.Devices
    ' If a device has been selected previously, get its
   ' name to select it later in the combo box.
    If ImagingControl.DeviceValid Then
        Name = ImagingControl.Device
        ' Get the index of the device in the collection.
        Idx = DeviceCollection.FindIndex(Name)
    End If
    If DeviceCollection.Count > 0 Then
        ' If devices have been found, add them to the
        ' combo box.
        For Each Item In DeviceCollection
            cboVideoSource.AddItem Item.Name
        cboVideoSource.Enabled = True
        If Idx <> -1 Then
            cboVideoSource.ListIndex = Idx - 1
            cboVideoSource.ListIndex = 0
        End If
        ' No devices have been found.
        cboVideoSource.AddItem "no devices found"
        cboVideoSource.Enabled = False
        cboVideoSource.ListIndex = 0
    End If
End Sub

A complete example of how to get the video capture device properties can be found in Making Device Settings.

See also: ICImagingControl, Devices, Device

<< ICImagingControl

Get in touch with us

About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us