我想创建一个程序,将bmp文件保存到我的pictures \ test中。 由于一些未知的原因,我得到了 - “GDI +中发生了一般性错误。” 请帮助我理解为什么会发生这种情况。 我的代码是:
System.Drawing.Image img = Properties.Resources.pic;
string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
string path2 = path+@"\"+"test";
img.Save(path2, System.Drawing.Imaging.ImageFormat.Bmp);
答案 0 :(得分:0)
可以是任意数量的东西,但请尝试保存图像的副本:
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(Properties.Resources.pic);
string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
string path2 = path+@"\"+"test";
bmp.Save(path2);