private void GDI_OnPaint(PaintEventArgs e) { using (_gdi.LockGraphics(e.Graphics)) { _gdi.StartOffScreenBitmap(Width, Height); // White Background _gdi.SetBrush(Color.White); _gdi.SetSolidPen(Color.White); _gdi.FillRectangle(0, 0, Width, Height); // Lag frame calculations SetLagFramesArray(); var visibleColumns = _columns.VisibleColumns.ToList(); if (visibleColumns.Any()) { DrawColumnBg(e, visibleColumns); DrawColumnText(e, visibleColumns); } // Background DrawBg(e, visibleColumns); // Foreground DrawData(e, visibleColumns); DrawColumnDrag(e); DrawCellDrag(e); _gdi.CopyToScreen(); _gdi.EndOffScreenBitmap(); } }
protected override void OnPaint(PaintEventArgs e) { using (var LCK = Gdi.LockGraphics(e.Graphics)) { Gdi.StartOffScreenBitmap(Width, Height); // White Background Gdi.SetBrush(Color.White); Gdi.SetSolidPen(Color.White); Gdi.FillRectangle(0, 0, Width, Height); Gdi.DrawString("Hello World", new Point(10, 10)); Gdi.CopyToScreen(); Gdi.EndOffScreenBitmap(); } }