title: when to use WriteableBitmap and BitmapImage in silverlight
body: <p>I am trying to display image using <code>BitmapImage</code>  for some time and it worked.I have changed  the image and it stopped working.</p>
  
  <p>For <code>Bitmapimage</code> I was using this code:</p>
  
  <pre><code>                            `ms.Seek(0, SeekOrigin.Begin); // ms is memory stream
                              BitmapImage b = new BitmapImage();
                              b.SetSource(ms);
                              image.ImageSource = b;`
  </code></pre>
  
  <p>I have ran into piece of code where it was checking if the length of the bytes[] ==14400 </p>
  
  <pre><code> if(bytes.length == 14400)
    {
    var bmp = new WriteableBitmap(width, height);
    Buffer.BlockCopy(buffer, 0, bmp.Pixels, 0, buffer.Length);
   }
  </code></pre>
  
  <p>I want to know when to use WriteableBitmap and BitmapImage .</p>