C#,將圖片完整顯示在picture元件中,pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;

C#,將圖片完整顯示在picture元件中,pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;

 

如下

retrievedImageBytes = (byte[])row.Cells["PHOTOS"].Value;

using (MemoryStream ms = new MemoryStream(retrievedImageBytes))
{
      pictureBox1.Image = Image.FromStream(ms);
      pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}

 

自我LV~