mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
ImageLoader
This commit is contained in:
parent
dfe3201625
commit
55d1ee933c
3 changed files with 27 additions and 23 deletions
|
|
@ -31,6 +31,14 @@ namespace MapControl
|
|||
HttpClient.DefaultRequestHeaders.Add("User-Agent", $"XAML-Map-Control/{typeof(ImageLoader).Assembly.GetName().Version}");
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadImageAsync(byte[] buffer)
|
||||
{
|
||||
using (var stream = new MemoryStream(buffer))
|
||||
{
|
||||
return await LoadImageAsync(stream);
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> LoadImageAsync(Uri uri, IProgress<double> progress = null)
|
||||
{
|
||||
ImageSource image = null;
|
||||
|
|
@ -67,14 +75,6 @@ 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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue