I need to convert a Stream into an IRandomAccessStream (in order to create a BitmapDecoder). I tried casting and searching for built-in methods for that in BitmapDecoder but couldn't find any.
So how do I do that?
There is an extension method for that:
Stream stream = GetSomeStream();
IRandomAccessStream randomAccessStream = stream.AsRandomAccessStream();
Just make sure that you have using System.IO at the top of your code file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With