protected override void OnPaint(PaintEventArgs e) { if (this.exampleBase == null) { base.OnPaint(e); return; } if (!_useGdiPlusOutput) { exampleBase.Draw(painter); Graphics g = e.Graphics; IntPtr displayDC = g.GetHdc(); bitmapBackBuffer.UpdateToHardwareSurface(displayDC); g.ReleaseHdc(displayDC); } else { exampleBase.Draw(painter); Graphics g = e.Graphics; IntPtr displayDC = g.GetHdc(); sx.RenderTo(displayDC, 0, 0, new PixelFarm.Drawing.Rectangle(0, 0, bufferBmpRect.Width, bufferBmpRect.Height)); g.ReleaseHdc(displayDC); } base.OnPaint(e); }
protected override void OnPaint(PaintEventArgs e) { if (this.exampleBase == null) { base.OnPaint(e); return; } if (!_useGdiPlusOutput) { exampleBase.Draw(painter); Graphics g = e.Graphics; IntPtr displayDC = g.GetHdc(); bitmapBackBuffer.UpdateToHardwareSurface(displayDC); g.ReleaseHdc(displayDC); } else { UpdateOutput(); } base.OnPaint(e); }