swharden / Spectrogram

.NET library for creating spectrograms (visual representations of frequency spectrum over time)
https://nuget.org/packages/Spectrogram
MIT License
316 stars 57 forks source link

problem with .net8 windows application #63

Closed behroozbc closed 2 hours ago

behroozbc commented 3 hours ago

Hi, I wanted to install and use this package on my windows form with .net 8 but I got this error message. image this is the cs proj file

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net8.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWindowsForms>true</UseWindowsForms>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ScottPlot" Version="5.0.45" />
    <PackageReference Include="Spectrogram" Version="1.6.1" />
  </ItemGroup>

</Project>

I think the package should not have depend on System.Drawing.Common version 4.6 and use imagesharp

swharden commented 3 hours ago

Hi @behroozbc, thanks for this question!

Microsoft sunset support for System.Drawing.Common in .NET 6, leading to this issue 😅 Although you could target .NET 5, there is probably a better option:

In the NuGet explorer you can click the "preview" checkbox to enable installing preview packages. The latest Spectrogram version is actually 2.0.0-alpha and it should work on modern .NET targets

Let me know if this does the trick!

swharden commented 3 hours ago

FYI, Spectrogram is migrating to SkiaSharp instead of ImageSharp because SkiaSharp is officially supported by Microsoft https://www.nuget.org/packages/SkiaSharp/ but ImageSharp is not and it is also not free https://sixlabors.com/pricing/

behroozbc commented 2 hours ago

I did not know about the plan to switch to ShiaSharp!!! Can I help you in this progress??

swharden commented 2 hours ago

I did not know about the plan to switch to ShiaSharp!!! Can I help you in this progress??

Thanks for your offer! I think the switch has already happened so most of the work is complete. It's still a preview package just because I haven't reviewed the API yet (I may want to refine it) and update the docs at the same time.

It's on my to-do list for this weekend now though 😎