![]() So here is my solution I came with after lot of googling and trial/error coding: Img.Source = bImg // image element in xaml convert the entire bitmap to a 100px by 100px bitmapīitmapBounds bounds = new BitmapBounds() InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream() īitmapEncoder enc = await BitmapEncoder.CreateForTranscodingAsync(ras, decoder) create a new stream and encoder for the new image Var fileStream = await file.OpenAsync() īitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream) create a stream from the file and decode the image StorageFile file = await StorageFile.GetFileFromPathAsync(filePath) String filePath = "C:\\Users\\Public\\Pictures\\Sample Pictures\\fantasy-dragons-wallpaper.jpg" Example of how to scale and crop taken from here: async private void BitmapTransformTest()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |