Quantcast
Channel: NodeXL: Network Overview, Discovery and Exploration for Excel
Viewing all articles
Browse latest Browse all 4386

New Post: image get locked when assigned as node shape

$
0
0
If I understand your problem, you cannot delete the file from disk without getting an IOException involving shared access. The solution is to set the BitmapImage.CacheOption property to BitmapCacheOption.OnLoad when you load the Bitmap from the file, as I indicated in my sample code. If you do that, you can delete the file at any time. If you don't do that (and your code snippet indicates that you aren't doing it now), then WPF will retain a reference to the file and you will be unable to delete it.

It makes no difference whether the file in question is the original file or a copy you've made of it. The cause of the problem is the same, and the solution to the problem is the same.

-- Tony

Viewing all articles
Browse latest Browse all 4386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>