Skip to content

Replace System.Drawing.Common with SkiaSharp to improve cross platform support #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 1, 2024
23 changes: 8 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,24 @@ jobs:
runs-on: windows-latest
steps:
- name: 🛒 Checkout
uses: actions/checkout@v2

- name: ✨ Setup .NET 6
uses: actions/setup-dotnet@v1
uses: actions/checkout@v4
- name: ✨ Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"

dotnet-version: "8.0.x"
- name: 🚚 Restore
run: dotnet restore src

- name: 🛠️ Build
run: dotnet build src --configuration Release --no-restore

run: dotnet build src --configuration Release
- name: 🧪 Test
run: dotnet test src --configuration Release --no-build

run: dotnet test src --configuration Release
- name: 📦 Pack
run: dotnet pack src --configuration Release --no-build

run: dotnet pack src --configuration Release
- name: 🔑 Configure Secrets
if: github.event_name == 'release'
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}

- name: 🚀 Deploy Package
- name: 🚀 Deploy NuGet Package
if: github.event_name == 'release'
run: nuget push "src\Spectrogram\bin\Release\*.nupkg" -SkipDuplicate -Source https://api.nuget.org/v3/index.json
6 changes: 0 additions & 6 deletions src/Spectrogram.MicrophoneDemo/App.config

This file was deleted.

5 changes: 3 additions & 2 deletions src/Spectrogram.MicrophoneDemo/FormMicrophone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SkiaSharp.Views.Desktop;

namespace Spectrogram.MicrophoneDemo
{
Expand Down Expand Up @@ -64,7 +65,7 @@ private void StartListening()
pbSpectrogram.Height = spec.Height;

pbScaleVert.Image?.Dispose();
pbScaleVert.Image = spec.GetVerticalScale(pbScaleVert.Width);
pbScaleVert.Image = spec.GetVerticalScale(pbScaleVert.Width).ToBitmap();
pbScaleVert.Height = spec.Height;
}

Expand All @@ -85,7 +86,7 @@ private void timer1_Tick(object sender, EventArgs e)
using (var gfx = Graphics.FromImage(bmpSpec))
using (var pen = new Pen(Color.White))
{
gfx.DrawImage(bmpSpecIndexed, 0, 0);
gfx.DrawImage(bmpSpecIndexed.ToBitmap(), 0, 0);
if (cbRoll.Checked)
{
gfx.DrawLine(pen, spec.NextColumnIndex, 0, spec.NextColumnIndex, pbSpectrogram.Height);
Expand Down
7 changes: 1 addition & 6 deletions src/Spectrogram.MicrophoneDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Runtime.Versioning;
using System.Windows.Forms;

namespace Spectrogram.MicrophoneDemo
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Expand Down
36 changes: 0 additions & 36 deletions src/Spectrogram.MicrophoneDemo/Properties/AssemblyInfo.cs

This file was deleted.

71 changes: 0 additions & 71 deletions src/Spectrogram.MicrophoneDemo/Properties/Resources.Designer.cs

This file was deleted.

117 changes: 0 additions & 117 deletions src/Spectrogram.MicrophoneDemo/Properties/Resources.resx

This file was deleted.

30 changes: 0 additions & 30 deletions src/Spectrogram.MicrophoneDemo/Properties/Settings.Designer.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Spectrogram.MicrophoneDemo/Properties/Settings.settings

This file was deleted.

14 changes: 5 additions & 9 deletions src/Spectrogram.MicrophoneDemo/Spectrogram.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<NoWarn>NU1701</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Spectrogram\Spectrogram.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FftSharp" Version="2.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="NAudio" Version="1.10.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
<PackageReference Include="FftSharp" Version="2.1.0" />
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="SkiaSharp.Views" Version="2.88.8" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions src/Spectrogram.MicrophoneDemo/packages.config

This file was deleted.

Loading
Loading