I'm not sure why the image remains locked. But I do know that System.Drawing namespace runs in unmanaged code, so you have to manually call dispose and delete the bitmap object.
>When we use System.Drawing.Bitmap, even if the class is released from memory after being out of scope, we still have to force a call to the Dispose() method to release the file. Otherwise, the file remained locked on disk for a while and we cannot replace the image. Can someone explain why this is necessary? What is going on internally in that System.Drawing.Bitmap exactly which forces such a call? I understand such a call could be useful down the code below if we would want to reassign a new image and such. But, when the object does out of scope, I was curious to know why the image remained locked on disk.
(On an infant's shirt): Already smarter than Bush