Back to Devexpress

HeatmapControl.CustomPaint Event

windowsforms-devexpress-dot-xtracharts-dot-heatmap-dot-heatmapcontrol-878c56f6.md

latest3.0 KB
Original Source

HeatmapControl.CustomPaint Event

Occurs after all the heatmap’s visual elements have been drawn.

Namespace : DevExpress.XtraCharts.Heatmap

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public event HeatmapCustomPaintEventHandler CustomPaint
vb
Public Event CustomPaint As HeatmapCustomPaintEventHandler

Event Data

The CustomPaint event's data class is HeatmapCustomPaintEventArgs. The following properties provide information specific to this event:

PropertyDescription
BoundsGets the bounds of a custom graphic object.
DXGraphicsGets the custom graphic object.

Remarks

Use the CustomPaint event to draw custom graphics over your heatmap.

The following example shows how to handle the CustomPaint event to draw a custom frame on a heatmap surface:

csharp
using DevExpress.Drawing;
using DevExpress.XtraCharts.Heatmap;
using System.Drawing;

namespace TestHeatmap {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            // ...
            heatmapControl1.CustomPaint += heatmapControl1_CustomPaint_1;
        }
        void heatmapControl1_CustomPaint_1(object sender, HeatmapCustomPaintEventArgs e) {
            using(DXPen pen = new DXPen(Color.Red, 2)) {
                e.DXGraphics.DrawRectangle(pen, this.heatmapControl1.Diagram.GetBounds());    
            }
        }
    }
}
vb
Imports DevExpress.Drawing
Imports DevExpress.XtraCharts.Heatmap
Imports System.Drawing

Namespace TestHeatmap
    Partial Public Class Form1
        Inherits Form

        Public Sub New()
            InitializeComponent()
            ' ...
            AddHandler heatmapControl1.CustomPaint, AddressOf heatmapControl1_CustomPaint_1
        End Sub
        Private Sub heatmapControl1_CustomPaint_1(ByVal sender As Object, ByVal e As HeatmapCustomPaintEventArgs)
            Using pen As New DXPen(Color.Red, 2)
                e.DXGraphics.DrawRectangle(pen, Me.heatmapControl1.Diagram.GetBounds())
            End Using
        End Sub
    End Class
End Namespace

See Also

HeatmapControl Class

HeatmapControl Members

DevExpress.XtraCharts.Heatmap Namespace