110,534
社区成员
发帖
与我相关
我的任务
分享
protected override void OnPaint(PaintEventArgs pe)
{
// Calling the base class OnPaint
base.OnPaint(pe);
ReDrawControl(pe.Graphics);
}
private void ReDrawControl(Graphics graphics)
{
//双缓冲绘图
Image BackImage = new Bitmap(Width, Height);
Graphics g = Graphics.FromImage(BackImage);
g.SmoothingMode = SmoothingMode.HighQuality; //高质量
g.PixelOffsetMode = PixelOffsetMode.HighQuality; //高像素偏移质量
DrawBackImage(g);
graphics.DrawImage(BackImage, 0, 0, Width, Height);
}