I am having a horrible time with the automatic image caching by WP7 platform.
I made a very simple app (I mean real simple). They have 2 images already added in solution as content of pix dimension 1280 x 2000 Here is XAML
<Grid x:Name="LayoutRoot" Background="Transparent" ManipulationCompleted="ImageHolder_ManipulationCompleted">
<Image x:Name="ImageHolder" />
<TextBlock x:Name="MemoryUsage" />
</Grid>
My .cs
ImageHolder.Source = null;
if (i % 2 == 0)
ImageHolder.Source = new BitmapImage(new Uri("image002.jpg", UriKind.Relative));
else
ImageHolder.Source = new BitmapImage(new Uri("image001.jpg", UriKind.Relative));
i++;
MemoryUsage.Text = "Device Total Memory = " + (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory") / (1024 * 1024)
+ "\nCurrent Memory Usage = " + (long)DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage") / (1024 * 1024)
+ "\nPeak Memory Usage = " + (long)DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage") / (1024 * 1024);
Memory usage is very high is equal to the 2 images in raw bitmap size, though there should only be one such instance. Please help, I am in dire need.