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.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

NuGet Package: DevExpress.Win.Navigation

#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