示例#1
0
文件: G910.cs 项目: Eeglis/Artemis
        /// <summary>
        ///     The G910 also updates the G-logo, G-badge and G-keys
        /// </summary>
        /// <param name="bitmap"></param>
        public override void DrawBitmap(Bitmap bitmap)
        {
            using (var croppedBitmap = new Bitmap(21 * 4, 6 * 4))
            {
                // Deal with non-standard DPI
                croppedBitmap.SetResolution(96, 96);
                // Don't forget that the image is upscaled 4 times
                using (var g = Graphics.FromImage(croppedBitmap))
                {
                    g.DrawImage(bitmap, new Rectangle(0, 0, 84, 24), new Rectangle(4, 4, 84, 24), GraphicsUnit.Pixel);
                }

                base.DrawBitmap(croppedBitmap);
            }

            using (var resized = OrionUtilities.ResizeImage(bitmap, 22, 7))
            {
                // Color the extra keys on the left side of the keyboard
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_LOGO, 0, 1);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_1, 0, 2);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_2, 0, 3);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_3, 0, 4);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_4, 0, 5);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_5, 0, 6);

                // Color the extra keys on the top of the keyboard
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_6, 3, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_7, 4, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_8, 5, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_9, 6, 0);

                // Color the G-badge
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_BADGE, 5, 6);
            }
        }
示例#2
0
文件: G810.cs 项目: rakosi2/Artemis
        /// <summary>
        ///     The G910 also updates the G-logo, G-badge and G-keys
        /// </summary>
        /// <param name="bitmap"></param>
        public override void DrawBitmap(Bitmap bitmap)
        {
            using (var croppedBitmap = new Bitmap(21 * 4, 6 * 4))
            {
                // Deal with non-standard DPI
                croppedBitmap.SetResolution(96, 96);
                // Don't forget that the image is upscaled 4 times
                using (var g = Graphics.FromImage(croppedBitmap))
                {
                    g.DrawImage(bitmap, new Rectangle(0, 0, 84, 24), new Rectangle(4, 4, 84, 24), GraphicsUnit.Pixel);
                }

                LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB);
                // TODO: Remapping
                LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap));
            }

            using (var resized = OrionUtilities.ResizeImage(bitmap, 21, 7))
            {
                // Color G-logo, lets also try some other values to see what happens
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_LOGO, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_BADGE, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_1, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_2, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_3, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_4, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_5, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_6, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_7, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_8, 0, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_9, 0, 0);
            }
        }
示例#3
0
        /// <summary>
        ///     The G910 also updates the G-logo, G-badge and G-keys
        /// </summary>
        /// <param name="bitmap"></param>
        public override void DrawBitmap(Bitmap bitmap)
        {
            // Base all actions on a downscaled bitmap since the bitmap is received upscaled
            using (var resized = OrionUtilities.ResizeImage(bitmap, Width, Height))
            {
                // Deal with non-standard DPI
                resized.SetResolution(96, 96);

                // LogiLedSetLightingFromBitmap doesn't include the special keys so cut the supported keys out of
                // the received bitmap and send them to the SDK as a whole
                using (var croppedBitmap = new Bitmap(Width - 1, Height - 1))
                {
                    croppedBitmap.SetResolution(96, 96);
                    using (var g = Graphics.FromImage(croppedBitmap))
                    {
                        g.DrawImage(resized, new Rectangle(0, 0, Width - 1, Height - 1), new Rectangle(1, 1, Width - 1, Height - 1), GraphicsUnit.Pixel);
                    }

                    LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB);
                    LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(croppedBitmap, G910Keymappings));
                }

                // Color the extra keys on the left side of the keyboard
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_LOGO, 0, 1);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_1, 0, 2);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_2, 0, 3);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_3, 0, 4);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_4, 0, 5);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_5, 0, 6);

                // Color the extra keys on the top of the keyboard
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_6, 3, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_7, 4, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_8, 5, 0);
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_9, 6, 0);

                // Color the G-badge
                SetLogitechColorFromCoordinates(resized, KeyboardNames.G_BADGE, 5, 6);
            }
        }
示例#4
0
 public override void DrawBitmap(Bitmap bitmap)
 {
     LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB);
     LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap));
 }
示例#5
0
文件: Orion.cs 项目: jgheld/Artemis
 public override void DrawBitmap(Bitmap bitmap)
 {
     LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap));
 }