你应该如何处理 BitmapSource ?
// this wont work because BitmapSource doesnt implement IDisposable
using(BitmapSource bitmap = new BitmapImage(new Uri("myimage.png")))
{
}
你应该如何处理 BitmapSource ?
// this wont work because BitmapSource doesnt implement IDisposable
using(BitmapSource bitmap = new BitmapImage(new Uri("myimage.png")))
{
}
您不必 Dispose() 一个BitmapSource。与框架中的一些其他“图像”类不同,它不包装任何本机资源。
只要让它超出范围,垃圾收集器就会释放它的内存。