i have a temp image file which i open with
Bitmap CapturedImg = (Bitmap)Image.FromFile("Item/Item.bmp");
and because is temp i want to replace it with another image for further use, but the program still using that image and i cannot do anything.
How to let go from the image in order to be replaced?
I had a similar problem and could not use using, since the file was overwritten by some asynchronous code. I solved the issue by making a copy of the Bitmap and freeing the original one: