protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (mBaseControl != null) { if (mGraphics == null) { mGraphics = new xGraphics(); } mGraphics.setGraphics(e.Graphics); if (mDoubleBuffer) { mGraphics.getGraphics().DrawImage(offScreenBmp, 0, 0); } else { mBaseControl.render(mGraphics); } } }
protected override void OnPaintBackground(PaintEventArgs pevent) { // ThuyPS: avoiding flickering technique if (mBaseControl != null && mDoubleBuffer) { if (offScreenBmp == null) { offScreenBmp = new Bitmap(mBaseControl.getW(), mBaseControl.getH()); offScreenDC = Graphics.FromImage(offScreenBmp); offG = new xGraphics(); offG.setGraphics(offScreenDC); } // background offG.getGraphics().Clear(this.BackColor); // render mBaseControl.render(offG); } else { base.OnPaintBackground(pevent); } }