GDI +中的一般错误 [英] A generic error in GDI+
本文介绍了GDI +中的一般错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在尝试使用代码来保存图像文件。
Hello,
I am trying following code to save image files.
Image img = new Bitmap(500, 500);
Graphics g = Graphics.FromImage(img);
Font font = new Font("Arial", 24);
PointF drawingPoint = new PointF(10, 10);
g.DrawString("Test Viprat", font, Brushes.Black, drawingPoint);
img.Save(@"C:\Test Tiff\2.tiff", ImageFormat.Tiff);
我在 img中遇到异常。保存
GDI +中的一般错误。
可以帮助我解决问题吗?
问候,
Viprat
I am getting exception in img.Save
A generic error in GDI+.
Can any help me what is the problem?
Regards,
Viprat
推荐答案
检查C:\ Test Tiff文件夹的访问权限,并且没有现有文件正在使用的那个名字。
我用我的临时文件夹在本地尝试你的代码,它工作正常。
Check your access permissions on the "C:\Test Tiff" folder, and that there isn't an existing file of that name in use.
I tried your code locally with my temporary folder and it worked fine.
这篇关于GDI +中的一般错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文