add c# binding including example
This commit is contained in:
parent
3bf5249d08
commit
eb723701cf
20 changed files with 884 additions and 5 deletions
19
examples/lang-cs/Program.cs
Normal file
19
examples/lang-cs/Program.cs
Normal 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);
|
||||
}
|
21
examples/lang-cs/lang-cs.csproj
Normal file
21
examples/lang-cs/lang-cs.csproj
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue