Beispiel #1
0
        private void SuperMouseMove()
        {
            if (superleftmouse)
            {
                Point position  = RCT_supergradient.PointToScreen(new Point(0d, 0d));
                Point Eposition = E_supercursor.PointToScreen(new Point(0d, 0d));

                Window parentWindow = Window.GetWindow(this);
                superColor.Color = GetRelativeColor((RCT_supergradient.Fill as LinearGradientBrush).GradientStops, GetGradientOffset(position.X - parentWindow.Left - 7, RCT_supergradient.Width + 1));
                SetGradient(superColor.Color);

                Point mouse = new Point
                {
                    X = MousePosition().X - (position.X - parentWindow.Left - 8),
                    Y = MousePosition().Y - (position.Y - parentWindow.Top - 31)
                };

                E_supercursor.Margin = new Thickness(mouse.X - (Eposition.X - E_supercursor.Margin.Left - parentWindow.Left) + (position.X - parentWindow.Left) - (E_supercursor.Width / 2), mouse.Y - (Eposition.Y - E_supercursor.Margin.Top - parentWindow.Top) + (position.Y - parentWindow.Top) - (E_supercursor.Height / 2), 0, 0);
                E_supercursor.Fill   = superColor;

                Point calcPos = new Point
                {
                    X = (E_cursor.Margin.Left - RCT_gradient.Margin.Left + (E_cursor.Width / 2)) / (RCT_gradient.Width / 255) / 255,
                    Y = (E_cursor.Margin.Top - RCT_gradient.Margin.Top + (E_cursor.Height / 2)) / (RCT_gradient.Height / 255) / 255
                };

                SolidColorBrush newColor = CalculateColor(calcPos, superColor);
                SetColor(newColor.Color.R, newColor.Color.G, newColor.Color.B);

                //new System.Drawing.Size(Convert.ToInt32(RCT_gradient.Width + 1), Convert.ToInt32(RCT_gradient.Height + 1));
            }
        }
Beispiel #2
0
        private void SuperMouseLeftButtonDown()
        {
            Window parentWindow = Window.GetWindow(this);
            Point  position     = RCT_supergradient.PointToScreen(new Point(0d, 0d));

            System.Windows.Forms.Cursor.Clip = new System.Drawing.Rectangle(new System.Drawing.Point()
            {
                X = Convert.ToInt32(position.X + 1),
                Y = Convert.ToInt32(position.Y + (RCT_supergradient.Height / 2))
            },
                                                                            new System.Drawing.Size(Convert.ToInt32(RCT_supergradient.Width + 2), 1));

            superleftmouse = true;
            SuperMouseMove();
        }