I am looking for a code snippet which opens a image, creates a clone of this bitmap in memory disposes this opened image so that all handles are closed.
Usually we can open a bitmap using this
Dim MyBit as new bitmap("C:\Image file.bmp") dim ClonedBit as bitmap = MyBit.clone MyBit.dispose
the following code however keeps the Image File locked until the application is running, any suggestions how to dispose it properly. (So that no handle is left open )
Things i already tried:
use dispose method of bitmap <= doesnt work (need to write implementation)
Using Block also doesnt work.