add c# binding including example

This commit is contained in:
Vinzenz Schroeter 2024-05-13 00:17:40 +02:00
parent 3bf5249d08
commit eb723701cf
20 changed files with 884 additions and 5 deletions

View file

@ -0,0 +1,19 @@
using ServicePoint2;
using var connection = Connection.Open("127.0.0.1:2342");
connection.Send(Command.Clear());
connection.Send(Command.Brightness(128));
using var pixels = PixelGrid.New(Constants.PixelWidth, Constants.PixelHeight);
for (var offset = 0; offset < int.MaxValue; offset++)
{
pixels.Fill(false);
for (var y = 0; y < pixels.Height; y++)
pixels[(y + offset) % Constants.PixelWidth, y] = true;
connection.Send(Command.BitmapLinearWin(0, 0, pixels.Clone()));
Thread.Sleep(14);
}

View file

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>lang_cs</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\servicepoint2-binding-cs\ServicePoint2\ServicePoint2.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\target\debug\libservicepoint2.so" CopyToOutputDirectory="Always">
<Link>libservicepoint2.so</Link>
</Content>
</ItemGroup>
</Project>