Cross-platform: remove System.Drawing deps, add #if WINDOWS
Refactored image creation APIs to use byte[] for logo data instead of System.Drawing.Image, enabling cross-platform support. Wrapped all GDI+/Windows-specific code in #if WINDOWS and updated project files to conditionally include Windows-only dependencies. Defaulted to ImageSharp on non-Windows, and updated UI and settings to reflect platform capabilities. Application now builds and runs on Linux/macOS with Avalonia and ImageSharp, while retaining full Windows functionality.
This commit is contained in:
parent
311b3e76f0
commit
73597689ed
16 changed files with 115 additions and 90 deletions
|
|
@ -1,19 +1,24 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<!-- Default assembly name for regular builds -->
|
||||
<AssemblyName>ImageCatalog</AssemblyName>
|
||||
<LangVersion>default</LangVersion>
|
||||
</PropertyGroup>
|
||||
<!-- Windows: net10.0-windows TFM auto-defines WINDOWS preprocessor symbol -->
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Windows'))">
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<UseWPF>true</UseWPF>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<PropertyGroup Condition="!$([MSBuild]::IsOsPlatform('Windows'))">
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Keep MinVer package enabled but do NOT let it overwrite AssemblyVersion/FileVersion used at build-time.
|
||||
|
|
@ -42,11 +47,11 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="AIFotoONLUS.Core" Version="0.1.1" />
|
||||
<PackageReference Include="AutoMapper" Version="16.0.0" />
|
||||
<PackageReference Include="MahApps.Metro" Version="2.4.11" />
|
||||
<PackageReference Include="MahApps.Metro" Version="2.4.11" Condition="$([MSBuild]::IsOsPlatform('Windows'))" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="6.2.1" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="6.2.1" Condition="$([MSBuild]::IsOsPlatform('Windows'))" />
|
||||
<PackageReference Include="MinVer" Version="7.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Avalonia" Version="11.3.0" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.3.0" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue