title: WPF image.source change during runtime, from byte[]. But image is blank(white)
body: <p>I am trying to change an image for <code>image1</code> during runtime. However the image turns blank(blank), what am I doing wrong?</p>
  
  <p><code>ImageAsBytes</code> is a <code>Byte[]</code> containing an image.
  <code>ScrollViewer1</code> is the where <code>image1</code> is located.</p>
  
  <pre><code>using (MemoryStream ms = new MemoryStream(ImagesAsBytes, 0, ImagesAsBytes.Length))
              {
                  BitmapImage image = new BitmapImage();
                  image.BeginInit();
                  image.StreamSource = ms;
                  image.EndInit();
  
              }
  image1.Source = image; 
  scrollViewer1.UpdateLayout();
  </code></pre>