.FromUri("http://www.someserver/someimage.jpg"); or equivalent?

Jul 22, 2012 at 11:27 AM

I'm trying to use WriteableBitmap in a W8 application to manipulate an image for which I have the URI. I can't figure out how to l would go about loading that image into a WriteableBitmap. I had hoped there'd be a FromUri extension similar to .FromResource(), but no luck. Am I missing something?

Jul 22, 2012 at 9:55 PM

I've since figured it out:

var randomAccessStreamReference = RandomAccessStreamReference.CreateFromUri(imageUri);
IRandomAccessStream randomAccessStream = await randomAccessStreamReference.OpenReadAsync();

var bitmap = await BitmapFactory.New(1, 1).FromStream(randomAccessStream);

Seems ridiculously simple now that I look at it. Ah well.