Florian
Florian

Reputation: 5994

Memory effective SetPixel

I've created a WPF Audiovisualation.
To draw the visualation I use a bitmap that sets pixel. You can see the basic idea here.

The problem is that I have to call BitmapSource.Create every second about 30 times. That causes a lot of wasted memory. The GC is doing a very nice job but that is not enough.

What can I do to solve that problem? I would need a bitmap that just updates from base byte array.

Upvotes: 1

Views: 154

Answers (1)

Timbo
Timbo

Reputation: 28050

You will want to use WritableBitmap as your BitmapSource.

Upvotes: 1

Related Questions