Bitmap original = new Bitmap("image.png"); Bitmap clone = (Bitmap)original.Clone(); original.Dispose(); // Unlocks "image.png" original = null; // optional // Now forget original. Work only on the clone. // ... clone.Save("image1.png"); File.Delete("image.png"); // Or, directly: clone.Save("image.png"); // Overwrites the original file which is now unlocked);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)