private void 保存toolStripButton_Click(object sender, EventArgs e)
{
DialogResult result;
string filename;
SaveFileDialog save = new SaveFileDialog();
save.CheckFileExists = false;
save.Filter = "jpg文件(*.jpg)|*.jpg|jpeg文件(*.jpeg)|*.jpeg|bmp文件(*.bmp)|*.bmp|gif文件(*.gif)|*.gif|ico文件(*.ico)|*.ico|png文件(*.png)|*.png|tif(文件)(*.tif)|*.tif|wmf文件(*.wmf)|*.wmf";
result = save.ShowDialog();
filename = save.FileName;
if (result == DialogResult.OK)
{
if (filename == string.Empty)
{
MessageBox.Show("Invaild file name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
string path = save.FileName;
this.pictureBox1.Image.Save(path, ImageFormat.Bmp);
}
}
}
我想一次可选择多个格式保存,
this.pictureBox1.Image.Save(path, ImageFormat.Bmp);
对于这一句的bmp对这个功能有什么影响?
请问怎么才能真正的保存多种格式呢?
追答差不多就是这样,自己补全格式
else