Take the 2-minute tour ×  I have a problem when I change
multiple times the image of an Image Container in the Windows
Phone 7.5  Here's the faulty code:  public void displayImages()
{     image1.Source = new
System.Windows.Media.Imaging.BitmapImage        (new
Uri("BrainImg/axis/" + axis + currentSlice + ".jpg",
image2.Source = new System.Windows.Media.Imaging.BitmapImage
(new Uri("BrainImg/aseg/" + axis + currentSlice + ".png",
private void slider1_ValueChanged(object sender,
RoutedPropertyChangedEventArgs<double> e)     // do something
if (this.slider1 != null)         currentSlice = (int)
this.slider1.Value;  After some changes (approximately 100 I ran
out of memory)  I have already tried setting the image.Source to
null before assigning a new value.  share|improve this question
how large are the images? –  Matthew Whited Mar 4 '12 at 0:14
256x256 24bit per pixel –  ppaulojr Mar 4 '12 at 0:29 add
comment  2 Answers  up vote 5 down vote accepted  The defau