Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Stream to IRandomAccessStream

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?

like image 525
ispiro Avatar asked Oct 19 '15 18:10

ispiro


1 Answers

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.

like image 94
Kevin Gosse Avatar answered Sep 27 '22 20:09

Kevin Gosse