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