C#如何用OpenFileDialog控件打开图片显示到PictureBox这个控件

openFileDialog1.Filter = "图片文件|*.jpg|BMP图片|*.bmp|Gif图片|*.gif";
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
picPhoto.Image = Image.FromFile(ofd.FileName);

转载于:https://www.cnblogs.com/luxiaoyao/p/5703071.html

你可能感兴趣的:(c#)