Ejemplo n.º 1
0
        // Draws a representation of the property's value.
        public override void PaintValue(System.Drawing.Design.PaintValueEventArgs e)
        {
            if (!(e.Value is ColourValue))
            {
                return;
            }

            ColourValue colVal = (ColourValue)e.Value;
            Color       col    = Color.FromArgb((int)colVal.GetAsARGB());

            int normalX = (e.Bounds.Width / 2);
            int normalY = (e.Bounds.Height / 2);

            // Fill rectangle indicating current color in property grid
            e.Graphics.FillRectangle(new SolidBrush(col), e.Bounds);

            System.Drawing.Rectangle alphaBounds = e.Bounds;
            alphaBounds.Width = (alphaBounds.Width * 30) / 100;
            //alphaBounds.X = alphaBounds.X + e.Bounds.Width - alphaBounds.Width;

            colVal.a = 1;
            col      = Color.FromArgb((int)colVal.GetAsARGB());
            e.Graphics.FillRectangle(new SolidBrush(col), alphaBounds);
        }