title: save image into isolated storage
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6372422/store-image-into-isolated-storage-in-windows-phone-7">store image into isolated storage in windows phone 7</a>  </p>
  </blockquote>
  
  
  
  <p>I am using Visual Studio/Expression Blend to create my app for windows phone 7. The user should be able to select a  picture that he/she wants to edit and after editing, the user can click a "save" button and the specific edited image will be saved in isolated storage. But I'm having trouble saving the image to Isolated Storage from the button click event.</p>
  
  <p>Does anyone have a code example of how this can be achieved? Thanks!</p>
  
  <p>My codes for the button :</p>
  
  <pre><code>using (var isoStore = IsolatedStorageFile.GetUserStoreForApplication()) 
  
  { 
  
  var bi = new BitmapImage(); bi.SetSource(pic); 
  
  var wb = new WriteableBitmap(lion.jpg,lion.jpg.RenderTransform); 
  
  using (var isoFileStream = isoStore.CreateFile("somepic.jpg")) 
  
  { 
  
  var width = wb.PixelWidth; 
  
  var height = wb.PixelHeight;
  
  Extensions.SaveJpeg(wb, isoFileStream, width, height, 0, 100); 
  
   } 
  }
  </code></pre>