Note that there are some explanatory texts on larger screens.

plurals
  1. POImport picture and save to isolated storage WP7
    text
    copied!<p>I am currently working on a project where the user needs to select a image from there photo gallery and import it. Using the following code I am able to import the picture but I have a few questions.</p> <ol> <li>What is the image named upon import?</li> <li>Where is the image located once imported</li> <li>Is it possible to save that image and reload it when the app is opened again (ie using isolated storage)</li> </ol> <p>Heres the code from a tutorial</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; using Microsoft.Phone.Tasks; using System.IO; using System.Windows.Media.Imaging; namespace PhoneApp4 { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); } PhotoChooserTask selectphoto = null; private void button1_Click(object sender, RoutedEventArgs e) { selectphoto = new PhotoChooserTask(); selectphoto.Completed += new EventHandler&lt;PhotoResult&gt;(selectphoto_Completed); selectphoto.Show(); } void selectphoto_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { BinaryReader reader = new BinaryReader(e.ChosenPhoto); image1.Source = new BitmapImage(new Uri(e.OriginalFileName)); } } } } </code></pre>
 

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