From 3cc93c746077bd83cdc3dbaa15ae2d6b97f4567f Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Wed, 22 May 2024 15:14:56 +0200 Subject: [PATCH] Update ImageLoader.WinUI.cs --- MapControl/WinUI/ImageLoader.WinUI.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MapControl/WinUI/ImageLoader.WinUI.cs b/MapControl/WinUI/ImageLoader.WinUI.cs index fc62c5da..66973940 100644 --- a/MapControl/WinUI/ImageLoader.WinUI.cs +++ b/MapControl/WinUI/ImageLoader.WinUI.cs @@ -34,6 +34,7 @@ namespace MapControl ExifOrientationMode.IgnoreExifOrientation, ColorManagementMode.DoNotColorManage); pixelData.DetachPixelData().CopyTo(image.PixelBuffer); + return image; } @@ -42,13 +43,12 @@ namespace MapControl // 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. // Alternatives are SoftwareBitmapSource or WriteableBitmap. -#if false - var image = new BitmapImage(); - await image.SetSourceAsync(stream); - return image; -#else + // + // var image = new BitmapImage(); + // await image.SetSourceAsync(stream); + // return image; + return await LoadImageAsync(await BitmapDecoder.CreateAsync(stream)); -#endif } public static Task LoadImageAsync(Stream stream)