servicepoint/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
2024-10-19 15:31:54 +02:00

25 lines
658 B
C#

using ServicePoint;
using var connection = Connection.Open("127.0.0.1:2342");
if (connection == null)
{
Console.Error.WriteLine("could not connect");
return;
}
connection.Send(Command.Clear());
connection.Send(Command.Brightness(Constants.MaxBrightness));
using var pixels = new Bitmap(Constants.PixelWidth, Constants.PixelHeight);
for (nuint offset = 0; offset < nuint.MaxValue; offset++)
{
pixels.Fill(false);
for (nuint y = 0; y < pixels.Height(); y++)
pixels[(y + offset) % Constants.PixelWidth, y] = true;
connection.Send(Command.BitmapLinearWin(0, 0, pixels.Clone(), CompressionCode.Lzma));
Thread.Sleep(14);
}