locked
Import Image Execption

    Question

  • hi all :) , i want to add an image to my app (the image is in the local package)..

    but an system.execption happens at await pictureToUpload.openAsync()...

    StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
                
                pictureToUpload = await folder.GetFileAsync("screeen.png");
                
                if (pictureToUpload != null)
                {
                    ButtonPicture.Visibility = Visibility.Collapsed;
                    
                    BitmapImage bitmapImage = new BitmapImage();
                    await bitmapImage.SetSourceAsync(await pictureToUpload.OpenReadAsync());
                    ImagePost.Source = bitmapImage;
                }

    Monday, May 11, 2015 5:24 PM

All replies

  • What is the exception?

    Does the file exist and is that the correct name (are three 'e's in "screeen" correct)?

    Monday, May 11, 2015 6:45 PM
    Moderator