saveFileDialog1.Filter = "JPEG File (*.jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp|PNG File(*.png)|*.png";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
switch (Path.GetExtension(saveFileDialog1.FileName))
{
case ".jpg":
pictureBox1.Image.Save(saveFileDialog1.FileName, ImageFormat.Jpeg); break;
case ".bmp":
pictureBox1.Image.Save(saveFileDialog1.FileName, ImageFormat.Bmp); break;
case ".png":
pictureBox1.Image.Save(saveFileDialog1.FileName, ImageFormat.Png); break;
}
}
attention : ImageFormat is available in "System.Drawing.Imaging" class
example:
PictureBox1.Image.Save("Address",System.Drawing.Imaging.ImageFormat.Bmp);