c# GDI+中发生一般性错误的解决办法
1,保存路径文件夹目录不存在(保存前先判断目录是否存在,不存在创建)
string path = System.IO.Directory.GetCurrentDirectory() + "\\img\\"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); }
2,图片在使用中,没有被释放掉
bitmap.Dispose();
1,保存路径文件夹目录不存在(保存前先判断目录是否存在,不存在创建)
string path = System.IO.Directory.GetCurrentDirectory() + "\\img\\"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); }
2,图片在使用中,没有被释放掉
bitmap.Dispose();