mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Version 4.10.0: Updated target framework versions. Cleanup of TypeConverters, ImageLoader, MBTileSource.
This commit is contained in:
parent
bdcd2597a1
commit
25cc04e2f2
5 changed files with 19 additions and 19 deletions
|
|
@ -18,30 +18,30 @@ namespace MapControl
|
|||
{
|
||||
public static partial class ImageLoader
|
||||
{
|
||||
public static async Task<ImageSource> CreateImageSourceAsync(IRandomAccessStream stream)
|
||||
public static async Task<ImageSource> LoadImageAsync(IRandomAccessStream stream)
|
||||
{
|
||||
var bitmapImage = new BitmapImage();
|
||||
await bitmapImage.SetSourceAsync(stream);
|
||||
return bitmapImage;
|
||||
}
|
||||
|
||||
public static async Task<ImageSource> CreateImageSourceAsync(byte[] buffer)
|
||||
public static async Task<ImageSource> LoadImageAsync(byte[] buffer)
|
||||
{
|
||||
using (var stream = new InMemoryRandomAccessStream())
|
||||
{
|
||||
await stream.WriteAsync(buffer.AsBuffer());
|
||||
stream.Seek(0);
|
||||
return await CreateImageSourceAsync(stream);
|
||||
return await LoadImageAsync(stream);
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<ImageSource> CreateImageSourceAsync(IHttpContent content)
|
||||
private static async Task<ImageSource> LoadImageAsync(IHttpContent content)
|
||||
{
|
||||
using (var stream = new InMemoryRandomAccessStream())
|
||||
{
|
||||
await content.WriteToStreamAsync(stream);
|
||||
stream.Seek(0);
|
||||
return await CreateImageSourceAsync(stream);
|
||||
return await LoadImageAsync(stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ namespace MapControl
|
|||
|
||||
using (var stream = await file.OpenReadAsync())
|
||||
{
|
||||
imageSource = await CreateImageSourceAsync(stream);
|
||||
imageSource = await LoadImageAsync(stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace MapControl
|
|||
{
|
||||
try
|
||||
{
|
||||
tile.SetImage(await ImageLoader.CreateImageSourceAsync(stream));
|
||||
tile.SetImage(await ImageLoader.LoadImageAsync(stream));
|
||||
tcs.SetResult(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue