Delete image source in silverlight for WP7

Can I programmatically delete the image file source? Or is it better to just set the source to a new bitmap that is undefined?

I am currently doing this:

BitmapImage bmpClear = new BitmapImage();
                CanvasImg.Source = bmpClear;

I never installed the source of bmpClear, so the previous image that was set by CanvasImg is deleted without replacement. Is this a good solution or will it lead to unintended consequences?

+3
source share
1 answer

You should just set it to zero and clear it

CanvasImg.Source = null;

But your solution should work very well.

+8
source

Source: https://habr.com/ru/post/1773346/


All Articles