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.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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);
}