public void ShowImage(string imagePath) { Bitmap image = new Bitmap(imagePath); image.MakeTransparent(Color.Transparent); PictureBox pictureBox = new PictureBox { Image = image, SizeMode = PictureBoxSizeMode.AutoSize, }; this.Controls.Add(pictureBox); this.ClientSize = pictureBox.Size; }