2
我想打開一個位圖文件,然後將其更改並保存,但出現一些錯誤。其代碼如下:如何打開位圖文件,將其更改並保存?
var tempFileNamePath = Path.Combine(workingDirectory, fileName);
Bitmap image = new Bitmap(tempFileNamePath);
var newImage = (Bitmap)image.Clone();
image.Dispose();
newImage.EnhanceImage();
newImage.Save(tempFileNamePath, System.Drawing.Imaging.ImageFormat.Jpeg);
newImage.Dispose();
但它無法保存與錯誤的文件:GDI中發生一般性錯誤+
爲什麼那朵正在發生的任何想法?
謝謝。重命名技巧不起作用,因爲我想對圖像執行一些圖像處理,然後保存它們。 – mans 2013-05-01 13:36:40