如何在指定的文件夹中保存图像 [英] How Can I Save Images In Specified Folder
本文介绍了如何在指定的文件夹中保存图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hai,
我是来自Windows播放器的censture sceenshot。通过按钮捕获。如果我按下按钮意味着自动将图像存储在特定文件夹中。不需要显示保存对话框。
我使用此代码进行保存。
Hai ,
I am ccapture sceenshot from windows player. capture through button. If i press the button means automatically store the images in particular folder.Don't need to show save dialog box.
I am using this code for save.
using (MemoryStream ms = new MemoryStream())
{
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ret = System.Drawing.Image.FromStream(ms);
ret.Save("Image.jpg");
}
推荐答案
尝试:
Try:
ret.Save(Path.Combine(@"C:\Path", "image.jpg"));
最后我这样做谢谢你的帮助...
public int count = 0,n = 0;
Finally i do that thanks for ur help...
public int count=0,n=0;
if(count==1)
{
using (MemoryStream ms = new MemoryStream())
{
string img = "Image";
string fo = ".jpg";
n = n + 1;
string n1 = Convert.ToString(n);
string imag = string.Concat(img + n1 + fo);
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ret = System.Drawing.Image.FromStream(ms);
ret.Save(Path.Combine(@"D:\Anand", imag));
count = 0;
}
}
Tnq ...
我工作了最后的商店仅捕获图像...
我想存储所有捕获的图像..
Tnq...
I Works t i store the last captured images only ...
I want to store all the captured images..
这篇关于如何在指定的文件夹中保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文