servicepoint-binding-csharp/ServicePoint.Example/Program.cs

23 lines
653 B
C#
Raw Normal View History

using System.Threading;
using ServicePoint;
2024-11-02 23:15:54 +01:00
2025-02-16 14:09:11 +01:00
// TODO: replace with new Connection("127.0.0.1:2342") to send to a real display
var connection = Connection.NewFake();
connection.Send(Command.Clear());
connection.Send(Command.Brightness(5));
2025-02-16 17:08:18 +01:00
connection.Send(Command.Utf8Data(0,0, CharGrid.Load("This is a test")));
var pixels = Bitmap.NewMaxSized();
2025-02-16 17:08:18 +01:00
for (ulong offset = 0; offset < pixels.Width(); offset++)
{
pixels.Fill(false);
for (ulong y = 0; y < pixels.Height(); y++)
pixels.Set((y + offset) % pixels.Width(), y, true);
2025-02-16 14:47:03 +01:00
connection.Send(Command.BitmapLinearWin(0, 0, pixels, CompressionCode.Lzma));
Thread.Sleep(14);
}