现在的位置: 首页 > 综合 > 正文

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

2012年08月04日 ⁄ 综合 ⁄ 共 550字 ⁄ 字号 评论关闭

            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);
                }
            }

抱歉!评论已关闭.