public void PaintHeaderBackground()
        {
            Graphics  g = Graphics;
            Rectangle r = ClientBounds;

            Color color      = BackColor;
            Color startColor = ColorConverter.AlphaBlendColor(Color.White, color, 100);

            if (IsTransparent)
            {
                color      = ColorConverter.AlphaColor(color, 200);
                startColor = ColorConverter.AlphaColor(startColor, 150);
                using (GraphicsPlus gp = new GraphicsPlus(g))
                {
                    PointF p1 = new PointF(r.X, r.Y);
                    PointF p2 = new PointF(r.X, r.Bottom);
                    using (LinearGradientBrush backGround = new LinearGradientBrush(p1, p2, startColor, color))
                    {
                        gp.FillRectangle(backGround, r);
                    }
                }
            }
            else
            {
                GdiExt.GradientFill(g, r, startColor, color, GdiExt.FillDirection.TopToBottom);
            }
        }
        private void PaintTemplateBackground()
        {
            Graphics  g = Graphics;
            Rectangle r = ClientBounds;

            Color color = BackColor;

            if (IsTransparent)
            {
                color = ColorConverter.AlphaColor(color, 220);
                using (GraphicsPlus gp = new GraphicsPlus(g))
                {
                    using (SolidBrushPlus backGround = new SolidBrushPlus(color))
                    {
                        gp.FillRectangle(backGround, r);
                    }
                }
            }
            else
            {
                using (SolidBrush brush = new SolidBrush(color))
                {
                    g.FillRectangle(brush, r);
                }
            }
        }
Beispiel #3
0
 private void CreateTransparentBGColor()
 {
     transparentBgColor = ColorConverter.AlphaColor(BackColor, alpha);
 }