I am trying to load images from a server asynchronously in window phone using the code below but the InMemoryRandomAccessStream brings the error
"The type or namespace name 'InMemoryRandomAccessStream' could not be found (are you missing a using directive or an assembly reference?)"
private async Task GetImageTaskAsync()
{
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("http://ts1.mm.bing.net/images/thumbnail.aspx?q=1080606601222&id=e7d54ea3862e939e6fd414b8750d86bdimage/jpeg1601204364");
byte[] img = await response.Content.ReadAsByteArrayAsync();
InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
DataWriter writer = new DataWriter(randomAccessStream.GetOutputStreamAt(0));
writer.WriteBytes(img);
await writer.StoreAsync();
BitmapImage b = new BitmapImage();
b.SetSource(randomAccessStream);
}
my using statements are as below
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using RaveCompass.Resources;
using System.Net;
using System.Windows;
using Windows.Storage.Streams;
using System.Xml.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
Kindly assist, and if there other ways i can load images from a website as asynchronously, kindly suggest