Added .NET 8 support

This commit is contained in:
ClemensFischer 2023-11-23 16:06:25 +01:00
parent b5c177b563
commit fa4841d6ca
16 changed files with 47 additions and 60 deletions

View file

@ -21,18 +21,6 @@ namespace MapControl
{
public static partial class ImageLoader
{
#if false
public static async Task<SoftwareBitmapSource> LoadImageAsync(BitmapDecoder decoder)
{
var image = new SoftwareBitmapSource();
var bitmap = await decoder.GetSoftwareBitmapAsync(
BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied, new BitmapTransform(),
ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage);
await image.SetBitmapAsync(bitmap);
return image;
}
#else
public static async Task<WriteableBitmap> LoadImageAsync(BitmapDecoder decoder)
{
var image = new WriteableBitmap((int)decoder.PixelWidth, (int)decoder.PixelHeight);
@ -43,7 +31,7 @@ namespace MapControl
pixelData.DetachPixelData().CopyTo(image.PixelBuffer);
return image;
}
#endif
public static async Task<ImageSource> LoadImageAsync(IRandomAccessStream stream)
{
// WinUI BitmapImage produces visual artifacts with Bing Maps Aerial (or all JPEG?)