- protected override void OnPaint(PaintEventArgs e)
- {
- this.DoubleBuffered = true;
- if (this.BackgroundImage != null)
- {
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
- e.Graphics.DrawImage(this.BackgroundImage, new System.Drawing.Rectangle(0, 0, this.Width, this.Height),
- 0, 0, this.BackgroundImage.Width, this.BackgroundImage.Height,
- System.Drawing.GraphicsUnit.Pixel);
- }
- base.OnPaint(e);
- }
- //该片段来自于http://www.codesnippet.cn/detail/0112201514142.html
来源: http://www.codesnippet.cn/detail/0112201514142.html