开发者

WPF Can you clear video memory?

开发者 https://www.devze.com 2022-12-13 23:05 出处:网络
I have a very rich media based application built in WPF, and Im using lots and 开发者_C百科lots of different PNG images to add animations and materials to 3D objects, as well as 2D animations.

I have a very rich media based application built in WPF, and Im using lots and 开发者_C百科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!


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.

0

精彩评论

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

关注公众号