Skip to main content

DXCustomPaintEventArgs Class

Provides data for the ChartControl.CustomPaint event when the chart is drawn on surfaces in GDI+ and DirectX modes.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.UI.dll

NuGet Package: DevExpress.Win.Charts

Declaration

public class DXCustomPaintEventArgs :
    CustomPaintEventArgs

Example

This example demonstrates how to use the DXCustomPaintEventArgs class to display a custom image over the chart.

public partial class MainForm : XtraForm {
    static readonly Image logo = new Bitmap("../../Images/DXLogo.png");

    public MainForm() {
        InitializeComponent();

        chartControl.CustomPaint += this.OnChartCustomPaint;
    }

    private void OnChartCustomPaint(object sender, CustomPaintEventArgs e) {
        if (!(e is DXCustomPaintEventArgs dxArgs)) return;
        dxArgs.Cache.DrawImage(logo, new Point(10, 10));
    }
}

Inheritance

See Also