In my xaml file I have an image named OutputImg. I also have a textblock named OutputTB for displaying the name of the image and a button which lets me choose an image from my Pictures folder.
Code behind :
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = Picker.ViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.PicutresLiibrary;
openPicker.FileTypeFilter.Add(".png");
StorageFile.file = await openPicker.PickSingleFileAsync();
OutputTB.text = file.Name;
BitmapImage image = new BitmapImage(new Uri(file.path));
OutputImg.Source = image;
}
Question is that even though I dont get any errors, my picture won't show. It writes out the picture's name to OutputTB.text but Image just stays empty. How can I make my selected image appear in the OutputImg image box.
I understand that there might be a really basic thing I'm missing here but its just meant to be a learning project