When you construct an instance of the GdiPlusRasterLayer class using a file name, it locks the file at the O/S level. What I'd like to do is re-use the same file name in order to store new raster images when the user switches map themes (from streets to hybrid mode, let's say). Each time I download a raster image I try to re-use the same file name, but then run into the locked file issue.
I remove the overlay from the map's overlay list, but that does not release the lock on the file at the O/S level.
What's the best way to do this?