c# GDI+中发生一般性错误的解决办法


 

1,保存路径文件夹目录不存在(保存前先判断目录是否存在,不存在创建)

            
            string path =  System.IO.Directory.GetCurrentDirectory() + "\\img\\";
           
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            

 

2,图片在使用中,没有被释放掉

bitmap.Dispose();

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM