DXWIN0001: DirectX-incompatible Graphics
In This Article
Severity: Error
It is generally recommended to avoid paint methods from the Graphics class since these methods are not functional if the DirectX Hardware Acceleration is on. Instead, use methods of the DevExpress.Utils.Drawing.GraphicsCache class.
#Invalid Code
C#
private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
e.Graphics.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
}
#Valid Code
C#
private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
e.Cache.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
}