예제 #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var borderThing = new Rectangle(0, 8, Width - 8, Height - 16);

            HSL half = Color;

            half.Luminance = 0.5f;
            ColorSpaceRenderer.GenerateColorSlider(e.Graphics, ColorSpaceHelper.HSLtoRGB(half).ToColor(), borderThing);

            ControlPaint.DrawBorder3D(e.Graphics, borderThing, Border3DStyle.SunkenOuter);

            float inc = (Height - 18) / 240.0f;

            float invLum = (240 - _curLum);

            e.Graphics.FillPolygon(Brushes.Black,
                                   new[]
            {
                new Point(Width - 7, 6 + (int)(invLum * inc) + 2),
                new Point(Width - 1, 12 + (int)(invLum * inc) + 2),
                new Point(Width - 1, 0 + (int)(invLum * inc) + 2),
            }
                                   );
        }
예제 #2
0
 private void GenerateSquare()
 {
     BackgroundImage = ColorSpaceRenderer.GenerateColorSquare(Width, Height);
 }