我想浏览图片并显示在图片框中,图片应该保存在一个文件夹中,可能在C:或D:驱动器中,我使用以下编码在图片框中浏览和显示
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
if (open.ShowDialog() == DialogResult.OK)
{
Image img = new Bitmap(open.FileName);
string imagename = open.SafeFileName;
Txt_countrylogo.Text = imagename;
pictureBox2.Image = img.GetThumbnailImage(340, 165, null, new IntPtr());
open.RestoreDirectory = true;
}
现在我需要帮助将图像保存在文件夹中,请提出一些想法。