Ejemplo n.º 1
0
        private void ColorMapControl_MouseMove(object sender, MouseEventArgs e)
        {
            if (_colormap == null)
            {
                return;
            }

            if (_leftMouseDown && (Math.Abs(_mouseDownPosition.X - e.X) > 2 || Math.Abs(_mouseDownPosition.Y - e.Y) > 2))
            {
                int          origin      = WorldToIndex(_mouseDownPosition.X);
                int          destination = WorldToIndex(e.X);
                List <Color> l           = _colormap.GetListCopy();

                Color c = l[origin];
                l[origin]      = l[destination];
                l[destination] = c;

                _tempMap       = new ColorMap(l);
                _draggingColor = true;
                Invalidate();
            }
        }