Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For this you have to store this file stream inside the IsolatedStorege. So create a filestream using IsolatedStorageFileStream and then save it, like this...</p> <pre><code>private void photoChooserTaskComplete(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { SaveToIsolatedStorage(e.ChosenPhoto,"Your File Name"); } </code></pre> <p>}</p> <pre><code> public void SaveToIsolatedStorage(Stream imageStream, string fileName) { try { string imagename = fileName + ".jpg"; using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(imagename)) { myIsolatedStorage.DeleteFile(imagename); } IsolatedStorageFileStream fileStream = myIsolatedStorage.CreateFile(imagename); WriteableBitmap wb = new WriteableBitmap(100, 100); wb.SetSource(imageStream); wb.SaveJpeg(fileStream, 100, 100, 0, 70); fileStream.Close(); } } catch (Exception) { RadMessageBox.Show(String.Empty, MessageBoxButtons.OK, "Error occured while saving Images"); } } </code></pre> <p>And for reading you can get that file from IsolatedStorage</p> <pre><code>public WriteableBitmap ReadFromIsolatedStorage(string fileName) { WriteableBitmap bitmap = new WriteableBitmap(100, 100); try { using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(fileName)) { using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile(fileName, FileMode.Open, FileAccess.Read)) { // Decode the JPEG stream. bitmap = PictureDecoder.DecodeJpeg(fileStream, 100, 100); } } } } catch (Exception) { RadMessageBox.Show(String.Empty, MessageBoxButtons.OK, "Error Occcured while reading image"); } return bitmap; } </code></pre> <p>This will solved your memory leak problem, try this...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload