title: Convert jpg to png and assign to image control
body: <p>I'm passing images between pages. But on the second page I want to convert image which is jpg to png with transparent background. 
  Finally I want to assign converted image to Image control, but I have error with implicitly convert type.</p>
  
  <p>Here is my code:</p>
  
  <p>First page:</p>
  
  <pre><code>WriteableBitmap wb = new WriteableBitmap(logoQrCodeImage, null);
  Byte[] array = ConvertImage.ConvertToBytes(wb);
  if (!IsolatedStorageSettings.ApplicationSettings.Contains("State"))
  {
      IsolatedStorageSettings.ApplicationSettings["State"] = array;
      IsolatedStorageSettings.ApplicationSettings.Save();
  }
  </code></pre>
  
  <p>Second page:</p>
  
  <pre><code>Byte[] array = IsolatedStorageSettings.ApplicationSettings["State"] as Byte[];
  MemoryStream stream = new MemoryStream(array);
  WriteableBitmap wb = new WriteableBitmap(50, 50);
  //wb.LoadJpeg(stream);
  
  var encoder = new PngEncoder();
  MemoryStream pngStream = new MemoryStream();
  ExtendedImage myImage;
  myImage = wb.ToImage();
  encoder.Encode(myImage, stream);
  
  icon.Source = myImage; //ERROR
  
  IsolatedStorageSettings.ApplicationSettings.Remove("State");
  IsolatedStorageSettings.ApplicationSettings.Save();
  </code></pre>
  
  <p>I'm using ImageTools library.</p>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Error 1   Cannot implicitly convert type 'ImageTools.ExtendedImage' to 'System.Windows.Media.ImageSource' </p>
  </blockquote>