I am able to display the picture in the picture box without checking the file size by the following code:
private void button3_Click_1(object sender, EventAr
UWP has currently a nice interface to obtain image properties.
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
// Application now has read/write access to the picked file
ImageProperties IP = await file.Properties.GetImagePropertiesAsync();
double Width = IP.Width;
double Height = IP.Height;
}