2016-11-20 56 views
0

我不知道這裏有什麼問題!它打開一個「OpenFileDialog」,它在圖片框中加載圖像,但圖像沒有被拉伸。請幫忙!謝謝:)PictureBox打開圖片 - C#

private void browsePic_Click(object sender, EventArgs e) 
    { 
     openPicture.Filter = "PNG|*.png|JPG|*.jpg;*.jpeg"; 
     if(openPicture.ShowDialog() == DialogResult.OK) 
     { 
      pictureBox2.BackgroundImageLayout = ImageLayout.Stretch; 
      pictureBox2.Image = new Bitmap(openPicture.FileName); 
     } 
    } 
+0

將圖片框大小設置爲自動? – Haris

回答