protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Rectangle rect = e.ClipRectangle;
BufferedGraphicsContext curentContext = BufferedGraphicsManager.Current;
BufferedGraphics myBuffer = curentContext.Allocate(e.Graphics, e.ClipRectangle);
Graphics g = myBuffer.Graphics;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighSpeed;
g.Clear(this.BackColor);
// To Do 繪一些你需要的信息到 g
......
//
myBuffer.Render(e.Graphics);
g.Dispose();
myBuffer.Dispose();
}