Skip to main content
All docs
V25.1
  • DXWIN0001: DirectX-incompatible Graphics

    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

    private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
       e.Graphics.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
    } 
    

    Valid Code

    private void GridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
       e.Cache.DrawRectangle(System.Drawing.Pens.Red, e.Bounds);
    }