在GDI +中发生Image.Save一般性错误()方法 [英] A Generic error occured in GDI+ in Image.Save() method
本文介绍了在GDI +中发生Image.Save一般性错误()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使用这个类,但我越来越在GDI +中Image.Save()方法中发生一般性错误。从我读一下它的一些流我需要关闭,但我不知道我使用这个调用哪一个。
I'm trying to use this class but I'm getting a Generic error occured in GDI+ in Image.Save() method. From what I read it's some stream I need to close but I don't know which one.
I'm calling using this:
Image image = Image.FromFile(@"C:\a.jpg");
using (var resized = ImageUtilities.ResizeImage(image, 50, 100))
{
//save the resized image as a jpeg with a quality of 90
ImageUtilities.SaveJpeg(@"C:\myimage.jpeg", resized, 90);
}
这是为什么错误,我该如何解决这个问题?
Why is that error and how do I solve this?
推荐答案
除非你的程序正在运行,但管理员无法直接保存到 C盘根:
使文件夹并将其保存在里面吧。
Unless your program is running as administrator you can not save directly to the root of C:
make a folder and save it inside there instead.
这篇关于在GDI +中发生Image.Save一般性错误()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文