如何在不使用对话框的情况下保存图像 [英] how to save an image without using dialog box

查看:57
本文介绍了如何在不使用对话框的情况下保存图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了此代码

i used this code

private void button2_Click(object sender, EventArgs e)
       {


           saveFileDialog1.InitialDirectory = "C:\\temp\\image.jpg";
           saveFileDialog1.Filter = "picture files (*.jpg)|*.jpg";
           saveFileDialog1.FilterIndex = 2;
           saveFileDialog1.RestoreDirectory = true;
           saveFileDialog1.ShowDialog();


       }



按下按钮会打开一个对话框,但是现在我需要一个代码,该代码允许我保存没有对话框的图片.....



on a press of a button it opens a dialog box,but now i need a code which allows me to save the pic without the dialog box.....

推荐答案

假设您的图片如下,只需在其上调用Save方法:
Assuming your image is the following, just call the Save method on it:
Image img;
img.Save("filename.jpg");


这篇关于如何在不使用对话框的情况下保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆