Back to Devexpress

CameraControl.GetAvailableDevices() Method

wpf-devexpress-dot-xpf-dot-editors-dot-cameracontrol-154de32b.md

latest2.8 KB
Original Source

CameraControl.GetAvailableDevices() Method

Returns the list of the DeviceInfo objects that contain information about video capture devices available on the current client machine.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public IEnumerable<DeviceInfo> GetAvailableDevices()
vb
Public Function GetAvailableDevices As IEnumerable(Of DeviceInfo)

Returns

TypeDescription
IEnumerable<DevExpress.Xpf.Editors.DeviceInfo>

A list of the DeviceInfo objects that contain information about video capture devices that are on the current client machine.

|

Remarks

A list of the DeviceInfo objects that contain information about video capture devices that are on the current client machine. The GetAvailableDevices method returns a list of the DeviceInfo objects that contain system information about video capture devices available on the current client machine. These objects can be used to change the video capture device currently used by this CameraControl. To do so, assign the required DeviceInfo object to the CameraControl.DeviceInfo property. Based on this info, the control will automatically create a valid CameraDevice object and assign it to the CameraControl.Device property.

The code below illustrates an example.

csharp
DeviceInfo myDeviceInfo = new DeviceInfo();
foreach (DeviceInfo device in Camera1.GetAvailableDevices())
{
    if (device.Name == "Front Camera") myDeviceInfo = device;
}
Camera1.DeviceInfo = myDeviceInfo;
vb
Dim myDeviceInfo As New DeviceInfo()
For Each device As DeviceInfo In Camera1.GetAvailableDevices()
    If device.Name = "Front Camera" Then
        myDeviceInfo = device
    End If
Next device
Camera1.DeviceInfo = myDeviceInfo

See Also

DeviceInfo

Device

CameraControl Class

CameraControl Members

DevExpress.Xpf.Editors Namespace