diff --git a/Artemis/Artemis/KeyboardProviders/Corsair/K95.cs b/Artemis/Artemis/KeyboardProviders/Corsair/K95.cs
index 08c899437..df000f39f 100644
--- a/Artemis/Artemis/KeyboardProviders/Corsair/K95.cs
+++ b/Artemis/Artemis/KeyboardProviders/Corsair/K95.cs
@@ -1,55 +1,61 @@
-using System.Drawing;
-using CUE.NET;
-using CUE.NET.Devices.Generic.Enums;
-using CUE.NET.Devices.Keyboard;
-using CUE.NET.Brushes;
-using CUE.NET.Devices.Keyboard.Keys;
-
-namespace Artemis.KeyboardProviders.Corsair
-{
- internal class K95 : KeyboardProvider
- {
- private CorsairKeyboard _keyboard;
-
- public K95()
- {
- Name = "Corsair Gaming K95 RGB";
- }
-
- ///
- /// Enables the SDK and sets updatemode to manual as well as the color of the background to black.
- ///
- public override void Enable()
- {
- try
- {
- CueSDK.Initialize();
- }
- catch (CUE.NET.Exceptions.WrapperException){/*CUE is already initialized*/}
- _keyboard = CueSDK.KeyboardSDK;
- Height = (int)_keyboard.KeyboardRectangle.Height;
- Width = (int)_keyboard.KeyboardRectangle.Width;
-
- _keyboard.UpdateMode = UpdateMode.Manual;
- _keyboard.Brush = new SolidColorBrush(Color.Black);
- _keyboard.Update(true);
- }
-
- public override void Disable()
- {
- }
-
- ///
- /// Properly resizes any size bitmap to the keyboard by creating a rectangle whose size is dependent on the bitmap size.
- /// Does not reset the color each time. Uncomment line 48 for collor reset.
- ///
- ///
- public override void DrawBitmap(Bitmap bitmap)
+using System.Drawing;
+using CUE.NET;
+using CUE.NET.Devices.Generic.Enums;
+using CUE.NET.Devices.Keyboard;
+using CUE.NET.Brushes;
+using CUE.NET.Devices.Keyboard.Keys;
+using System;
+
+namespace Artemis.KeyboardProviders.Corsair
+{
+ internal class K95 : KeyboardProvider
+ {
+ private CorsairKeyboard _keyboard;
+
+ public K95()
{
+ Name = "Corsair Gaming K95 RGB";
+ }
+
+ ///
+ /// Enables the SDK and sets updatemode to manual as well as the color of the background to black.
+ ///
+ public override void Enable()
+ {
+ try
+ {
+ CueSDK.Initialize();
+ }
+ catch (CUE.NET.Exceptions.WrapperException){/*CUE is already initialized*/}
+ _keyboard = CueSDK.KeyboardSDK;
+ Height = (int)_keyboard.KeyboardRectangle.Height;
+ Width = (int)_keyboard.KeyboardRectangle.Width;
+
+ // _keyboard.UpdateMode = UpdateMode.Manual;
+ _keyboard.Update(true);
+ }
+
+ public override void Disable()
+ {
+ }
+
+ ///
+ /// Properly resizes any size bitmap to the keyboard by creating a rectangle whose size is dependent on the bitmap size.
+ /// Does not reset the color each time. Uncomment line 48 for collor reset.
+ ///
+ ///
+ public override void DrawBitmap(Bitmap bitmap)
+ {
+ //bitmap = new Bitmap(@"C:\Users\Hazard\Desktop\1920x1080.png");
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);
+ Color pixelColor = resize.GetPixel((int)item.KeyRectangle.X, (int)item.KeyRectangle.Y);
+ if (pixelColor.Name == "0")
+ {
+ pixelColor = Color.Black;
+ }
+ item.Led.Color = pixelColor;
}
_keyboard.Update();
}
@@ -74,6 +80,6 @@ namespace Artemis.KeyboardProviders.Corsair
_keyboard.DetachKeyGroup(ledGroups[x, y]);
}
}
- */
- }
+ */
+ }
}
\ No newline at end of file