Skip to main content

CameraControl Class

Represents a control that displays a video stream captured from a video input device.

Namespace: DevExpress.Xpf.Editors

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

NuGet Package: DevExpress.Wpf.Core

Declaration

public class CameraControl :
    Control,
    ICameraDeviceClient

Remarks

The CameraControl object represents a control that displays a video stream from a video capture device, and provides an end-user with the capability to operate the device and adjust the video qualities.

In the top far corner the CameraControl displays the predefined Settings button. The visibility of this button is controlled by the CameraControl.ShowSettingsButton property. This button invokes the Camera Settings panel, which allows an end-user to select the desired camera whenever multiple devices are plugged in and adjust the video settings (resolution, brightness, contrast, etc.).

The CameraControl automatically detects video capture devices. At run time, the Camera Settings panel allows an end-user to select the device from which to capture the video stream. In code, for this purpose, use the CameraControl.DeviceInfo property. To get the list of all available devices, call the CameraControl.GetAvailableDevices method.

The CameraControl allows you to operate the selected device - start and stop the video stream display, and take snapshots. To start capturing video from currently selected device, call the CameraControl.Start method. However, when the control is loaded, the video stream can automatically start to display from the default camera device. To prevent this, set the CameraControl.AllowAutoStart property to false. When you need to terminate capturing video, call the CameraControl.Stop method.

To get the video frame currently displayed by the control, call the CameraControl.TakeSnapshot method. This method returns a bitmap image that uses the 32 bit format to store color data.

Also, the CameraControl provides you with the capability to adjust the video qualities on video capture devices. Typically, video capture devices support the brightness, contrast, hue, saturation, gamma, and sharpness properties. The availability of a video quality setting, as well as the extreme and default values, depends on the particular video capture device. At run time, an end-user can invoke the Camera Settings panel to adjust the video properties on available devices. In code, you can get access to the video through the CameraControl.DeviceSettings property.

See Also