title: Convert BitmapImage to SoftwareBitmap in UWP
body: <p>I need to find out how to convert a BitmapImage object into a SoftwareBitmap in order to save it to a file without losing resolution as I would do with RenderTargetBitmap.</p>
  
  <p>I have the following situation:</p>
  
  <pre><code>private void TakePic() {
      BitmapImage currentImage = new BitmapImage(new Uri("http://.../image.jpg"));
      ImageControl.Source = currentImage;
  }
  
  private void SavePic() {
      StorageFile file = await folder.CreateFileAsync(...);
      using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.ReadWrite))
      {
          BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, stream);
          encoder.SetSoftwareBitmap();
          await encoder.FlushAsync();
      }
  }   
  </code></pre>
  
  <p>I can't use RenderTargetBitmap on ImageControl because my image from url is way bigger than the ImageControl size. With RenderTargetBitmap I would shrink my output to the size of this control.</p>
  
  <p>Is there any workaround to achieve this?</p>