Skip to content

Commit dc53434

Browse files
committed
Demo update
1 parent 636b032 commit dc53434

2 files changed

Lines changed: 3 additions & 46 deletions

File tree

SpawnDev.MatrixLEDDisplay/Components/LEDMatrix.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
_canvas.Width = _canvasSize;
112112
_canvas.Height = _canvasSize;
113113
_tmr.Elapsed += timer_elapsed;
114-
_tmr.Interval = 666;
114+
_tmr.Interval = 750;
115115
_tmr.Enabled = true;
116116
}
117117
DrawData();

SpawnDev.MatrixLEDDisplay/MIMatrixDisplay.cs

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public double Gamma
156156
_ = Resend();
157157
}
158158
}
159-
RGBPixel _backgroundColor = (194, 136, 36);
159+
RGBPixel _backgroundColor = (24, 16, 8);
160160
/// <summary>
161161
/// This color will be used as the background color for images with transparency.
162162
/// </summary>
@@ -629,7 +629,7 @@ public async Task Resend()
629629
if (!SourceData.Any()) return;
630630
if (SourceIsSlideShow)
631631
{
632-
await SendSlideShow(SourceData, _save);
632+
await SendSlideShow(SourceData.ToList(), _save);
633633
}
634634
else
635635
{
@@ -794,49 +794,6 @@ private async Task SendSlideShowImage(byte index, byte count, bool save, RGBImag
794794
SetBusy(false);
795795
}
796796
}
797-
//private async Task SendSlideShowImage(byte index, byte count, bool save, RGBAImage imageData)
798-
//{
799-
// if (LEDCharacteristic == null) return;
800-
// if (imageData.Width != 16 || imageData.Height != 16) throw new ArgumentOutOfRangeException("Image must be 16x16 pixels");
801-
// SetBusy(true);
802-
// try
803-
// {
804-
// // process transparency
805-
// var DrawnData = imageData.ToRGBImage(BackgroundColor);
806-
// // process gamma and send
807-
// var gammaCorrection = 1d / Gamma;
808-
// await LEDCharacteristic.WriteValueWithoutResponse(Command.SlideShowImageWriteEnable(count));
809-
// await Task.Delay(5);
810-
// for (int blockIndex = 0; blockIndex < 8; blockIndex++)
811-
// {
812-
// var blockData = new byte[96];
813-
// for (var i = 0; i < 32; i++)
814-
// {
815-
// var pixelIndex = blockIndex * 32 + i;
816-
// var srcPixel = DrawnData[pixelIndex];
817-
// var r = srcPixel.R;
818-
// var g = srcPixel.G;
819-
// var b = srcPixel.B;
820-
// blockData[i * 3] = GammaCorrect(r, gammaCorrection); // Red
821-
// blockData[i * 3 + 1] = GammaCorrect(g, gammaCorrection); // Green
822-
// blockData[i * 3 + 2] = GammaCorrect(b, gammaCorrection); // Blue
823-
// }
824-
// await LEDCharacteristic.WriteValueWithoutResponse(Command.SlideShowImageWriteChunk(index, (byte)(blockIndex + 1), blockData));
825-
// await Task.Delay(5);
826-
// }
827-
// if (count == index && save)
828-
// {
829-
// await LEDCharacteristic.WriteValueWithoutResponse(Command.SlideShowMarker);
830-
// await Task.Delay(5);
831-
// }
832-
// await LEDCharacteristic.WriteValueWithoutResponse(Command.SlideShowImageWriteDisable(count));
833-
// await Task.Delay(5);
834-
// }
835-
// finally
836-
// {
837-
// SetBusy(false);
838-
// }
839-
//}
840797
/// <summary>
841798
/// Disconnect and release resources
842799
/// </summary>

0 commit comments

Comments
 (0)