c# - BitmapSource.Create creates two copies of image data -


is an application that processes many images, memory footprint is approximately twice the size of the estimated size.

I have shown below that my code has been cut down, _source is a frequency variable that resides in the scope:

  int width = 9 24; Height of intensity = 1116; Int length = width * height; UInt32 [] data = new UInt32 [length]; _source = BitmapSource.Create (width, height, 96, 96, pixel format. Pg 32, empty, data, width * size (UInt32)); _source.Freeze ();  

If I feed it through an ANTS memory profiler then I get allocated to BillMapsSafIHindal and increase the memory usage every time it moves, bitmap size is about twice .

What am I not doing? Do I have to live with this? Any information appreciated all.

Cheers, Nigel


Comments