Ejemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            using (SolidBrush b = new SolidBrush(BackColor))
            {
                e.Graphics.FillRectangle(b, ClientRectangle);
            }
            RectangleF wheelrect = WheelRectangle;

            Util.DrawFrame(e.Graphics, wheelrect, 6, m_frameColor);

            wheelrect = ColorWheelRectangle;
            PointF center = Util.Center(wheelrect);

            e.Graphics.SmoothingMode = SmoothingMode.HighSpeed;
            if (m_brush == null)
            {
                m_brush                = new PathGradientBrush(m_path.ToArray(), WrapMode.Clamp);
                m_brush.CenterPoint    = center;
                m_brush.CenterColor    = Color.White;
                m_brush.SurroundColors = m_colors.ToArray();
            }
            e.Graphics.FillPie(m_brush, Util.Rect(wheelrect), 0, 360);
            DrawColorSelector(e.Graphics);

            if (Focused)
            {
                RectangleF r = WheelRectangle;
                r.Inflate(-2, -2);
                ControlPaint.DrawFocusRectangle(e.Graphics, Util.Rect(r));
            }
        }
Ejemplo n.º 2
0
        void DrawColorSelector(Graphics dc)
        {
            Rectangle r      = Util.Rect(ColorSelectorRectangle);
            PointF    center = Util.Center(r);
            Image     image  = SelectorImages.Image(SelectorImages.eIndexes.Donut);

            dc.DrawImageUnscaled(image, (int)(center.X - image.Width / 2), (int)(center.Y - image.Height / 2));
        }
Ejemplo n.º 3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            DrawColorBar(e.Graphics);

            if (Focused)
            {
                RectangleF lr = ClientRectangleF;
                lr.Inflate(-2, -2);
                ControlPaint.DrawFocusRectangle(e.Graphics, Util.Rect(lr));
            }
        }