Simplified WPF ImageLoader

This commit is contained in:
ClemensFischer 2023-08-18 17:44:33 +02:00
parent 2094facc5e
commit d7eb26f9cd
3 changed files with 31 additions and 44 deletions

View file

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
@ -65,6 +66,14 @@ namespace MapControl
return image;
}
public static async Task<ImageSource> LoadImageAsync(byte[] buffer)
{
using (var stream = new MemoryStream(buffer))
{
return await LoadImageAsync(stream);
}
}
internal class HttpResponse
{
public byte[] Buffer { get; }