开发者

Remove Image Source in silverlight for WP7

开发者 https://www.devze.com 2023-01-23 13:52 出处:网络
Is it possible to programatically remove the source of an Image file?Or is it better to just set the source to a new bitmap that is undefined?

Is it possible to programatically remove the source of an Image file? Or is it better to just set the source to a new bitmap that is undefined?

The current way I'm doing开发者_如何学JAVA it is:

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

I never set the source of bmpClear, so the previous image that was set to CanvasImg is removed with nothing to replace it. Is this a good solution or will this cause unintended consequences?


You should be able to just set it to null and clear it out

CanvasImg.Source = null;

But your solution should work just fine as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消