Beispiel #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Graphics g = e.Graphics;

            ColorPickRenderer.ColorTriangleInPlace(g, _currentHue, Width - thickness * 2, thickness);

            g.DrawImageUnscaled(wheel, 0, 0);

            g.SmoothingMode = SmoothingMode.AntiAlias;

            PointF p = ColorPickUtil.RotatePoint(clickPoint, new PointF(Width / 2.0f, Width / 2.0f),
                                                 ColorPickUtil.DegreeToRadian(rotatePoint ? _currentHue - initRot : 0));

            if (drawPoint)
            {
                g.DrawEllipse(new Pen(Negative(CurrentHSV), 2), new RectangleF(p.X - 3, p.Y - 3, 6, 6));
            }

            PointF start = ColorPickUtil.RotatePoint(new PointF(Width - thickness, (Height / 2.0f) - 1.5f),
                                                     new PointF(Width / 2.0f, Width / 2.0f),
                                                     ColorPickUtil.DegreeToRadian(_currentHue));
            PointF end = ColorPickUtil.RotatePoint(new PointF(Width, (Height / 2.0f) - 1.5f),
                                                   new PointF(Width / 2.0f, Width / 2.0f),
                                                   ColorPickUtil.DegreeToRadian(_currentHue));

            g.DrawLine(new Pen(Negative(new ColorManager.HSVColor(CurrentHSV.H, 100, 100)), 2), start, end);
        }
Beispiel #2
0
 private void ColorPick_Load(object sender, EventArgs e)
 {
     wheel = ColorPickRenderer.ColorWheel(Width, 14, 4);
 }
Beispiel #3
0
 protected override void OnSizeChanged(EventArgs e)
 {
     thickness = (14);
     wheel     = ColorPickRenderer.ColorWheel(Width, thickness, 4);
     base.OnSizeChanged(e);
 }