我有這樣的代碼覆蓋現有圖片
private void saveImage()
{
Bitmap bmp1 = new Bitmap(pictureBox.Image);
bmp1.Save("c:\\t.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
// Dispose of the image files.
bmp1.Dispose();
}
我已經有一個形象t.jpg在我的硬盤「C:\」。
我想在每次運行程序時用新圖像替換它。但一個GDI +錯誤顯示
我該如何解決它?
可能的重複http://stackoverflow.com/questions/1036115/c-sharp-gdi-overwriting-an-image-using-save-method-of-bitmap – 2012-01-18 05:45:47
http://stackoverflow.com/questions/ 838063 /覆蓋圖像文件位圖 – 2012-01-18 05:46:31