WPF 可以清除视频内存吗?
我在 WPF 中构建了一个非常丰富的基于媒体的应用程序,并且我使用大量不同的 PNG 图像将动画和材质添加到 3D 对象以及 2D 动画。
我注意到视频内存很快就填满了,我正在考虑尝试清除它。
我似乎无法通过 C# 执行任何操作来强制清除视频内存,所以我想知道引用图形(BitmapImage 对象)的对象上的普通 GC 是否会清除视频内存?
多谢!
I have a very rich media based application built in WPF, and Im using lots and lots of different PNG images to add animations and materials to 3D objects, as well as 2D animations.
I have noticed that quickly the video memory fills up, and Im looking into trying to clear it.
I don't seem to be able to do anything through C# to force the video memory to get cleared, so Im wondering if a normal GC on objects that reference the graphics (BitmapImage objects) will clear out the Video Memory?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我最终发现了什么
(通过这里的帮助:
http://social. msdn.microsoft.com/Forums/en-US/wpf/thread/181da889-31a2-4e4c-b87e-d864577a41d4
)
是我需要取消引用 BitmapImages 的静态列表,以便将它们从视频内存中清除。
我保留它们并假设当没有材质引用位图时,位图将从视频内存中删除。
Ok, so what I ended up finding out
(via help here:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/181da889-31a2-4e4c-b87e-d864577a41d4
)
was that I needed to de-reference my static lists of BitmapImages in order to clear them out of video memory.
I was keeping them around and making the assumption that when no materials were referencing the bitmaps, then the bitmaps would be removed from the video memory.