Exemple #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            GraphicsHelper helper = new GraphicsHelper(e.Graphics);

            helper.Gradient(UColor.Blend(0x30, UColor.Black), UColor.Transparent, new Rectangle(0, 0, this.Width, this.Height / 2), 90);
            helper.Line(UColor.Blend(0x60, UColor.Black), 0, 0, this.Width, 0);
        }
Exemple #2
0
            protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
            {
                GraphicsHelper helper = new GraphicsHelper(e.Graphics);

                Rectangle shadow = new Rectangle(
                    e.TextRectangle.X + 1,
                    e.TextRectangle.Y + 1,
                    e.TextRectangle.Width,
                    e.TextRectangle.Height);

                uint shadowColor = UColor.Blend(0x10, UColor.White);
                uint textColor   = UColor.Argb(255, 0xBB, 0xBB, 0xBB);

                if (e.Item.Selected || e.Item.Pressed)
                {
                    shadowColor = UColor.Blend(0x7a, UColor.White);
                    textColor   = UColor.White;
                }

                StringFormat format = new StringFormat();

                format.LineAlignment = StringAlignment.Center;
                format.Alignment     = StringAlignment.Near;

                if (!e.Item.Selected)
                {
                    helper.Text(e.Text, e.TextFont, shadowColor, shadow, format);
                }
                helper.Text(e.Text, e.TextFont, textColor, e.TextRectangle, format);
            }
Exemple #3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            GraphicsHelper helper = new GraphicsHelper(e.Graphics);

            const int r            = 7;
            const int shadowHeight = 4;

            Rectangle bounds         = new Rectangle(0, 0, this.Width - 1, this.Height - 1 - shadowHeight);
            Rectangle rectShadow     = new Rectangle(0, 0, Width - 1, Height - 1);
            Rectangle rectText       = bounds;
            Rectangle rectTextShadow = new Rectangle(1, 1, rectText.Width - 2, rectText.Height - 1);

            if (Image != null)
            {
                rectText = new Rectangle(bounds.X, bounds.Y, bounds.Width + Image.Width, bounds.Height);
            }

            helper.RoundedFill(UColor.White, bounds, r);

            if (!Hover)
            {
                if (Enabled)
                {
                    //32C437: Main color
                    //2AA92E: Shadow
                    //0A890D: Outline
                    const uint color         = 0x32c437;
                    const uint color_shadow  = 0x2aa92e;
                    const uint color_outline = 0x0a890d;
                    helper.RoundedFill(UColor.Blend(255, color_shadow), rectShadow, r);
                    helper.RoundedGradient(UColor.Blend(200, color), UColor.Blend(255, color), bounds, 90, r);
                    helper.RoundedOutline(UColor.Blend(255, color_outline), rectShadow, r);

                    helper.Text(Caption, this.Font, UColor.White, rectTextShadow);
                    helper.Text(Caption, this.Font, UColor.Blend(0xdd, UColor.White), rectText);
                }
                else
                {
                }
            }
            else
            {
                if (!Pressed)
                {
                }
                else
                {
                }
            }

            if (Image != null)
            {
                e.Graphics.DrawImage(this.Image, new Point(this.Width / 4 - this.Image.Width / 2, this.Height / 2 - this.Image.Height / 2));
            }
        }
Exemple #4
0
            protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
            {
                GraphicsHelper helper = new GraphicsHelper(e.Graphics);
                Rectangle      bounds = e.AffectedBounds;

                helper.Line(UColor.Blend(155 / 2, UColor.Rgb(0x06, 0x88, 0xD8)), 0, bounds.Width, bounds.Height - 3);
                helper.Line(UColor.Blend(155, UColor.Rgb(0x06, 0x88, 0xD8)), 0, bounds.Width, bounds.Height - 2);
                helper.Line(UColor.Rgb(0x06, 0x88, 0xD8), 0, bounds.Width, bounds.Height - 1);
//				helper.Line(UColor.Rgb(25, 25, 25), 0, bounds.Width, bounds.Height - 1);

                base.OnRenderToolStripBorder(e);
            }
Exemple #5
0
        public void OnPaintItem(PaintEventArgs e, MenuBarItem item)
        {
            GraphicsHelper helper = new GraphicsHelper(e.Graphics);
            const int      radius = 3;
            Rectangle      bound  = item.Bound;

            helper.RoundedGradient(UColor.Rgb(0x4d, 0x9f, 0xcf), UColor.Rgb(0x15, 0x69, 0x97), item.Bound, 90, radius);
            helper.Gradient(UColor.Blend(130, UColor.White), UColor.Blend(70, UColor.White), new Rectangle(item.Bound.X, item.Bound.Y + 1, 1, item.Bound.Height - radius), 90);
            helper.Gradient(UColor.Blend(130, UColor.White), UColor.Blend(70, UColor.White), new Rectangle(item.Bound.X + item.Bound.Width - radius + 2, item.Bound.Y + 1, 1, item.Bound.Height - radius), 90);
            helper.RoundedOutline(UColor.Rgb(0x18, 0x18, 0x18), item.Bound, radius);
            helper.Line(UColor.White, bound.X + radius, bound.Y + bound.Height - 1, bound.Width - radius, bound.Y + bound.Height - 1);
        }
Exemple #6
0
        public void OnPaintBarBackground(PaintEventArgs e)
        {
            GraphicsHelper graphics = new GraphicsHelper(e.Graphics);
            const int      radius   = 7;
            const int      blend    = 245;
            Rectangle      bound    = new Rectangle(DisplayRectangle.X + 1, DisplayRectangle.Y, Width - 3, Height - 2);

            graphics.RoundedFill(UColor.White, bound, radius);
            graphics.RoundedGradient(UColor.Blend(blend, UColor.Rgb(60, 60, 60)), UColor.Blend(blend, UColor.Rgb(38, 38, 38)), bound, 90, radius);
            graphics.RoundedOutline(UColor.Black, new Rectangle(bound.X + 1, bound.Y + 1, bound.Width - 1, bound.Height - 1), radius);
            graphics.Line(UColor.Blend(50, UColor.White), radius, 0, Width - radius, 0);
        }