@@ -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