protected override void OnPaint(PaintEventArgs e) {
if (this.Image != null) {
var res = resizeImage(this.Image, this.ClientSize);
e.Graphics.FillRectangle(SystemBrushes.Window, this.ClientRectangle);
e.Graphics.DrawImage(res, (this.Size.Width - res.Width) / 2, (this.Size.Height - res.Height) / 2);
}
}