Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CameraControl.GetDevices() Method

Returns the list of the CameraDeviceInfo objects containing information about the available video capture devices. This is a static method.

Namespace: DevExpress.XtraEditors.Camera

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public static List<CameraDeviceInfo> GetDevices()

#Returns

Type Description
List<CameraDeviceInfo>

A list of the CameraDeviceInfo objects containing information about the available video capture devices.

#Remarks

The static GetDevices method returns the list of the CameraDeviceInfo objects that contain system information about video capture devices on the current client machine. The returned information can be used to create CameraDevice objects that represent capture devices and can be assigned to the CameraControl.Device property or passed as a parameter to the CameraControl.Start method.

The code snippet below demonstrates how to display a context button for each found capture device and provide an end-user with the capability to start capturing video with a click on that button.

using DevExpress.XtraEditors.Camera;
using DevExpress.Data.Camera;
using DevExpress.Utils;

CameraControl cc = new CameraControl();
foreach(CameraDeviceInfo cdi in CameraControl.GetDevices()){
    ContextButton cb = new ContextButton();
    cb.Caption = cdi.Name;
    cb.Click += (o, a) => cc.Start(CameraControl.GetDevice(cdi));
    cc.ContextButtons.Add(cb);
}
See Also