protected override void Detach() { base.Detach(); if (image != null) { ClientSize = pictureBox1.Size = new Size(image.Width, image.Height); } }