I found out this being the way to have the smoothest scrolling,
I need to have a 60 fps scrolling of a 70Mb bitmap I rendered previously in memory, after some profiling with WPF Performance Suite, it eats about 800Mb of GPU ! I get periodic slow downs in the FPS, I guess cleaning up 800Mb takes some time or something
else, anyway this is just an unacceptable behavior.
Moreover, my laptop has shared memory which means it can uses up to 1.5Gb of the 4Gb of RAM so it does affect the available resources for other programs.
My first solution was to use a WriteableBitmap and update its BackBuffer, it's not as smooth but it does use only 4Mb.
In case you wonder, I am NOT creating an InteropBitmap every time, I create it on the beginning, then when I update it I do some CopyMemory then InteropBitmap.Invalidate.
Also, the image size I display is 1920*256 at 32bpp.
There's no way for us to clean that memory more often...
Is this a bug in InteropBitmap ?
Thanks for your help :-)
Here is the code:
(BASS is an audio library for .NET : http://www.un4seen.com/ )
View Complete Post