var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/test.jpg", UriKind.RelativeOrAbsolute)); ImageProperties imageProperties = await file.Properties.GetImagePropertiesAsync(); canvas.Width = imageProperties.Width; canvas.Height = imageProperties.Height;