ICImagingControl.Devices Property |
||
Returns a collection of all available video capture devices. | ||
Syntax: | Public Devices As 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. 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 cboVideoSource.Clear 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 Next cboVideoSource.Enabled = True If Idx <> -1 Then cboVideoSource.ListIndex = Idx - 1 Else cboVideoSource.ListIndex = 0 End If Else ' 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 |