pissing about
This commit is contained in:
@@ -6,6 +6,7 @@ public class MatrixRenderer
|
||||
private readonly WledDdpClient _wled;
|
||||
private readonly int _width = 64;
|
||||
private readonly int _height = 64;
|
||||
private readonly string _fontType = "monospace";
|
||||
|
||||
public MatrixRenderer(string wledIp)
|
||||
{
|
||||
@@ -22,18 +23,24 @@ public class MatrixRenderer
|
||||
canvas.Clear(SKColors.Black);
|
||||
|
||||
// --- DRAW CLOCK ---
|
||||
using SKPaint clockPaint = new SKPaint { Color = SKColors.Cyan, IsAntialias = false };
|
||||
using SKTypeface typeface = SKTypeface.FromFamilyName("monospace");
|
||||
using SKFont clockFont = new SKFont(typeface, 16);
|
||||
string timeFormat = (currentTime.Second % 2 == 0) ? "HH:mm" : "HH mm";
|
||||
using SKPaint clockPaint = new SKPaint { Color = SKColors.Red, IsAntialias = false };
|
||||
using SKTypeface typeface = SKTypeface.FromFamilyName(_fontType);
|
||||
using SKFont clockFont = new SKFont(typeface, 14);
|
||||
//string timeFormat = (currentTime.Second % 2 == 0) ? "HH:mm" : "HH mm";
|
||||
string timeFormat = "HH:mm:ss";
|
||||
string timeString = currentTime.ToString(timeFormat);
|
||||
canvas.DrawText(timeString, 4, 16, SKTextAlign.Left, clockFont, clockPaint);
|
||||
|
||||
// --- DRAW TEMPERATURE ---
|
||||
using SKPaint textPaint = new SKPaint { Color = SKColors.Orange, IsAntialias = false };
|
||||
using SKFont textFont = new SKFont { Size = 16 };
|
||||
canvas.DrawText($"{currentTemp:F1}c", 4, 30, SKTextAlign.Left, textFont, textPaint);
|
||||
canvas.DrawText($"{currentWater:F1}%", 4, 50, SKTextAlign.Left, textFont, textPaint);
|
||||
using SKPaint textPaintTemp = new SKPaint { Color = SKColors.Green, IsAntialias = false };
|
||||
using SKTypeface typefaceTemp = SKTypeface.FromFamilyName(_fontType);
|
||||
using SKFont textFont = new SKFont { Size = 14 };
|
||||
canvas.DrawText($"{currentTemp:F1}ºc", 4, 33, SKTextAlign.Left, textFont, textPaintTemp);
|
||||
//Water
|
||||
using SKPaint textPaintWater = new SKPaint { Color = SKColors.Blue, IsAntialias = false };
|
||||
using SKTypeface typefaceWater = SKTypeface.FromFamilyName(_fontType);
|
||||
using SKFont textFontWater = new SKFont { Size = 14 };
|
||||
canvas.DrawText($"{currentWater:F1}%", 4, 50, SKTextAlign.Left, textFontWater, textPaintWater);
|
||||
|
||||
// 4. Convert 32-bit RGBA to 24-bit RGB for WLED
|
||||
byte[] rgbaBytes = bitmap.Bytes;
|
||||
|
||||
Reference in New Issue
Block a user