Possible Duplicate:
store image into isolated storage in windows phone 7
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.
Does anyone have a code example of how this can be achieved? Thanks!
My codes for the button :
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);
}
}