Dispose of a BitmapImage

主宰稳场 提交于 2019-12-12 02:44:00

问题


I have a Windows Universal App which uses several BitmapImages. I'm used to wrapping Bitmaps (in Winforms) in usings or using Dispose, but I've discovered that BitmapImage doesn't have a Dispose method. Is there any way to release their resources earlier than waiting for the GC to do that?


回答1:


Here's a good solution : Memory consumption of BitmapImage/Image control in Windows Phone 8 . it's like a extension 'Dispose' method for the BitmapImage

And yes, GC.Collect() is good way ..



来源:https://stackoverflow.com/questions/33108983/dispose-of-a-bitmapimage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!