Stream stream = await GetStreamAsync("https://images.com/img1.jpg");
image.Source = ImageSource.FromStream(() => stream);
async Task<Stream> GetStreamAsync(string uri)
{
TaskFactory factory = new TaskFactory();
WebRequest request = WebRequest.Create(uri);
WebResponse response = await factory.FromAsync<WebResponse>(request.BeginGetResponse,
request.EndGetResponse,
null);
return response.GetResponseStream();
}
Yorumlar
Yorum Gönder