Update ImageLoader.WinUI.cs

This commit is contained in:
ClemensFischer 2024-05-22 15:14:56 +02:00
parent f8687ad3b7
commit 3cc93c7460

View file

@ -34,6 +34,7 @@ namespace MapControl
ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage); ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage);
pixelData.DetachPixelData().CopyTo(image.PixelBuffer); pixelData.DetachPixelData().CopyTo(image.PixelBuffer);
return image; return image;
} }
@ -42,13 +43,12 @@ namespace MapControl
// WinUI BitmapImage produces visual artifacts with Bing Maps Aerial (or all JPEG?) // WinUI BitmapImage produces visual artifacts with Bing Maps Aerial (or all JPEG?)
// images in a tile raster, where thin white lines may appear as gaps between tiles. // images in a tile raster, where thin white lines may appear as gaps between tiles.
// Alternatives are SoftwareBitmapSource or WriteableBitmap. // Alternatives are SoftwareBitmapSource or WriteableBitmap.
#if false //
var image = new BitmapImage(); // var image = new BitmapImage();
await image.SetSourceAsync(stream); // await image.SetSourceAsync(stream);
return image; // return image;
#else
return await LoadImageAsync(await BitmapDecoder.CreateAsync(stream)); return await LoadImageAsync(await BitmapDecoder.CreateAsync(stream));
#endif
} }
public static Task<ImageSource> LoadImageAsync(Stream stream) public static Task<ImageSource> LoadImageAsync(Stream stream)