mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Found a way better way to update keyboard dynamically. Left old code in for people to laugh at me.
This commit is contained in:
parent
3fdb2093e7
commit
977f88fde9
@ -46,6 +46,15 @@ namespace Artemis.KeyboardProviders.Corsair
|
|||||||
/// <param name="bitmap"></param>
|
/// <param name="bitmap"></param>
|
||||||
public override void DrawBitmap(Bitmap bitmap)
|
public override void DrawBitmap(Bitmap bitmap)
|
||||||
{
|
{
|
||||||
|
Bitmap resize = new Bitmap(bitmap, new Size((int)_keyboard.KeyboardRectangle.Width, (int)_keyboard.KeyboardRectangle.Height));
|
||||||
|
foreach (var item in _keyboard.Keys)
|
||||||
|
{
|
||||||
|
item.Led.Color = resize.GetPixel((int)item.KeyRectangle.X, (int)item.KeyRectangle.Y);
|
||||||
|
}
|
||||||
|
_keyboard.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
RectangleF[,] ledRectangles = new RectangleF[bitmap.Width, bitmap.Height];
|
RectangleF[,] ledRectangles = new RectangleF[bitmap.Width, bitmap.Height];
|
||||||
RectangleKeyGroup[,] ledGroups = new RectangleKeyGroup[bitmap.Width, bitmap.Height];
|
RectangleKeyGroup[,] ledGroups = new RectangleKeyGroup[bitmap.Width, bitmap.Height];
|
||||||
//_keyboard.Brush = new SolidColorBrush(Color.Black);
|
//_keyboard.Brush = new SolidColorBrush(Color.Black);
|
||||||
@ -65,6 +74,6 @@ namespace Artemis.KeyboardProviders.Corsair
|
|||||||
_keyboard.DetachKeyGroup(ledGroups[x, y]);
|
_keyboard.DetachKeyGroup(ledGroups[x, y]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ namespace Artemis.Utilities.GameState
|
|||||||
|
|
||||||
_listener.Prefixes.Clear();
|
_listener.Prefixes.Clear();
|
||||||
Port = Settings.General.Default.GamestatePort;
|
Port = Settings.General.Default.GamestatePort;
|
||||||
_listener.Prefixes.Add($"http://127.0.0.1:{Port}/");
|
_listener.Prefixes.Add($"http://localhost:{Port}/");
|
||||||
|
|
||||||
_listener.Start();
|
_listener.Start();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user