IC Imaging Control .NET

ICImagingControl.Devices Property

ICImagingControl.Devices Property

Returns a collection of all available video capture devices.
Syntax:
[VB.NET]
Public Devices() As Device
[C#]
public Device[] Devices;
Limitations:

Run time only, read only.

Sample:

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.

[VB.NET]
cboVideoSource.Items.Clear() If IcImagingControl1.Devices.Length > 0 Then ' If devices have been found, add them to the combobox. Dim ICDevice As Device For Each ICDevice In IcImagingControl1.Devices cboVideoSource.Items.Add(ICDevice.Name) Next cboVideoSource.Enabled = True cboVideoSource.SelectedIndex = cboVideoSource.Items.IndexOf(IcImagingControl1.Device) Else ' No devices have been found. cboVideoSource.Items.Add("no devices found") cboVideoSource.Enabled = False cboVideoSource.SelectedIndex = 0 End If
[C#]
cboVideoSource.Items.Clear(); if (ICImagingControl1.Devices.Length > 0) { // If devices have been found, add them to the combobox. foreach (Device Dev in ICImagingControl1.Devices) { cboVideoSource.Items.Add(Dev.Name); } cboVideoSource.Enabled = true; cboVideoSource.SelectedIndex = cboVideoSource.Items.IndexOf(ICImagingControl1.Device); } else { // No devices have been found. cboVideoSource.Items.Add("no devices found"); cboVideoSource.Enabled = false; cboVideoSource.SelectedIndex = 0; }

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