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?)

View file

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-windows10.0.17763.0;net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net8.0-windows10.0.17763.0;net7.0-windows10.0.17763.0;net6.0-windows10.0.17763.0</TargetFrameworks>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseRidGraph>true</UseRidGraph>
<UseWinUI>true</UseWinUI>
<RootNamespace>MapControl</RootNamespace>
<AssemblyTitle>XAML Map Control Library for WinUI</AssemblyTitle>
@ -26,7 +27,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230724000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
</ItemGroup>
</Project>