Can anyone tell me how to solve this problem?
I have using the JpegBitmapEncoder to get the stream from the BitmapImage as like in the following code snippet.
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
MemoryStream stream = new MemoryStream();
encoder.Frames.Add(BitmapFrame.Create(bitmapImage));
encoder.Save(stream);
But the application memory size is increase huge. I have loading the image with size as 10 MB.
When using the 10 MB size image to the Image control at load time:
Memory size: 230
When using the 10 MB size image to the Image control at load time and convert the BitmapImage to the stream using the JpegBitmapEncoder:
Memory size: 352
When using the 50 KB size image to the Image control:
memory size: 72
When using the 50 KB size image to the Image control at load time and convert the BitmapImage to the stream using the JpegBitmapEncoder:
Memory size: 80
Also tried to dispose the stream with a Using statement and dispose method also. But still the application memory not reduced.
Sample Link: https://github.com/bharathirajauk/MySamples/tree/master/ShapesLoading
