servicepoint/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs

25 lines
658 B
C#
Raw Permalink Normal View History

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