Further RGB.NET updates

This commit is contained in:
Robert committed 2021-03-06 00:07:40 +01:00
1 parent 5bcba8a4a5
commit 4b914718e6
6 files changed
+15 -8

No files matched your search

-2
View File
@@ -258,10 +258,8 @@ namespace Artemis.Core.Services
private void InvalidateBitmap()
{
lock (_bitmapLock)
{
_bitmap?.Dispose();
_bitmap = null;
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace Artemis.Core.Services
Task.Run(async () =>
{
await Task.Delay(200);
ledGroup.Detach(_rgbService.Surface);
ledGroup.Detach();
if (blinkCount < 5)
{
+4 -1
View File
@@ -136,8 +136,11 @@ namespace Artemis.Core.Services
public void UpdateTexture(SKBitmap bitmap)
{
SKTexture? oldTexture = Texture;
Texture = new SKTexture(bitmap);
TextureBrush.Texture = Texture;
oldTexture?.Dispose();
}
private void SurfaceOnLayoutChanged(SurfaceLayoutChangedEventArgs args) => UpdateLedGroup();
@@ -161,7 +164,7 @@ namespace Artemis.Core.Services
lock (_surfaceLedGroup)
{
// Clean up the old background
_surfaceLedGroup.Detach(Surface);
_surfaceLedGroup.Detach();
// Apply the application wide brush and decorator
_surfaceLedGroup = new ListLedGroup(Surface, LedMap.Select(l => l.Key)) { Brush = TextureBrush };