C# winform 另存为picturebox里的图片带对话框

            saveFileDialog.Filter = "Jpg 图片|*.jpg|Bmp 图片|*.bmp|Gif 图片|*.gif|Png 图片|*.png|Wmf  图片|*.wmf";
            saveFileDialog.FilterIndex = 0;
            if (pic_Spare.Image == null)
            {
                MessageBox.Show("没有预览图片!","提示:",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
            else if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                if (pic_Spare.Image != null)
                {
                    pic_Spare.Image.Save(saveFileDialog.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
                }
            }

你可能感兴趣的:(WinForm)