时间:2021-01-25 10:29:34 | 栏目:.NET代码 | 点击:次
//保存图象文件
private void SaveImage(Image image)
{
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string fileName = saveFileDialog.FileName;
string extension = Path.GetExtension(fileName);
if (extension == ".jpg")
{
image.Save(fileName, ImageFormat.Jpeg);
}
else
{
image.Save(fileName, ImageFormat.Bmp);
}
}
}