protected override void OnPaint(PaintEventArgs pe) { if (wallpaper == null) { base.OnPaint(pe); } else { pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias; BitmapPainter.CopyImageScaled((Bitmap)wallpaper, pe.Graphics, 0, 0, this.Width, this.Height); base.OnPaint(pe); } }