Skip to main content

CameraControl.CustomDrawFrame Event

Occurs before the CameraControl‘s frame is drawn. Subscribe to customize the video stream’s frame.

Namespace: DevExpress.XtraEditors.Camera

Assembly: DevExpress.XtraEditors.v24.2.dll

Declaration

[DXCategory("Property Changed")]
public event CustomDrawFrameEventHandler CustomDrawFrame

Event Data

The CustomDrawFrame event's data class is DevExpress.XtraEditors.Camera.CustomDrawFrameEventArgs.

Remarks

The example below demonstrates how to add a text to the camera’s stream.

using System.Drawing;
using DevExpress.XtraEditors.Camera;

private void cameraControl1_CustomDrawFrame(object sender, CustomDrawFrameEventArgs e) {
    CameraControl camera = (CameraControl)sender;
    e.DefaultDraw();
    e.Cache.DrawString(
        "Cool camera", 
        this.Font, 
        Brushes.Red, 
        new Point(camera.Width/2-50, camera.Height-50 ));
    e.Handled = true;
}
See Also