【发布时间】:2016-11-20 11:09:56
【问题描述】:
我不知道这里有什么问题!它打开一个“OpenFileDialog”,它在 PictureBox 中加载图像,但图像没有被拉伸。请帮忙!谢谢:)
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);
}
}
【问题讨论】:
-
图片框大小设为自动?
标签: c# picturebox openfiledialog