Convert StorageFile to a BitmapImage in Universal Windows Apps

We have already seen how to convert a WritableBitmap to a StorageFile in Universal Windows apps. A StorageFile can be converted to a BitmapImage using the following function. public class ImageUtils { public static async Task<BitmapImage> StorageFileToBitmapImage(StorageFile savedStorageFile) { using (IRandomAccessStream fileStream = await savedStorageFile.OpenAsync(Windows.Storage.FileAccessMode.Read)) { BitmapImage bitmapImage = new BitmapImage(); bitmapImage.DecodePixelHeight = 100; bitmapImage.DecodePixelWidth […]

Read More

Converting WritableBitmap to StorageFile in Universal Windows Apps

WriteableBitmap is quite useful when an app requires image processing. It provides a BitmapSource, that can be written and manipulated. Ultimately that bitmap source is supplied to an image control of a Windows Store app. We are going to save the WritableBitmap to a StorageFile in our app. For image encoding WinRT offers the BitmapEncoder […]

Read More