コード例 #1
0
ファイル: SaturationSlider.cs プロジェクト: yanfudi/mcskin3d
        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
ファイル: ColorSquare.cs プロジェクト: NovaDelta/mcskin3d
 private void GenerateSquare()
 {
     BackgroundImage = ColorSpaceRenderer.GenerateColorSquare(Width, Height);
 }