ComponentFactory.Krypton.Toolkit.KryptonOffice2013Renderer.GradientItemColorsTracking.DrawBack C# (CSharp) Method

DrawBack() public method

public DrawBack ( Graphics g, Rectangle rect ) : void
g System.Drawing.Graphics
rect System.Drawing.Rectangle
return void
            public override void DrawBack(Graphics g, Rectangle rect)
            {
                Rectangle inset = new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2);
                Rectangle insetB = new Rectangle(rect.X + 2, rect.Y + 2, rect.Width - 3, rect.Height - 3);
                Rectangle insetC = new Rectangle(rect.X + 2, rect.Y + 2, rect.Width - 4, rect.Height - 4);

                using (LinearGradientBrush insideBrush1 = new LinearGradientBrush(rect, Back1B, Back1, 90f),
                                           insideBrush2 = new LinearGradientBrush(insetB, Back2B, Back2, 90f))
                {
                    insideBrush1.SetSigmaBellShape(0.5f);
                    insideBrush2.SetSigmaBellShape(0.5f);

                    g.FillRectangle(insideBrush1, inset);
                    using (GraphicsPath borderPath = CreateBorderPath(insetC, _cutInnerItemMenu),
                                        clipPath = CreateBorderPath(insetB, _cutInnerItemMenu))
                    {
                        using (Pen insidePen = new Pen(insideBrush2))
                            g.DrawPath(insidePen, borderPath);

                        g.FillPath(insideBrush2, borderPath);

                        using (Clipping clipping = new Clipping(g, clipPath))
                        {
                            using (GraphicsPath ellipsePath = new GraphicsPath())
                            {
                                RectangleF ellipseRect = new RectangleF(-(rect.Width / 2), rect.Bottom - 9, rect.Width * 2, 18);
                                PointF ellipseCenter = new PointF(ellipseRect.Left + (ellipseRect.Width / 2), ellipseRect.Top + (ellipseRect.Height / 2));
                                ellipsePath.AddEllipse(ellipseRect);

                                using (PathGradientBrush insideLighten = new PathGradientBrush(ellipsePath))
                                {
                                    insideLighten.CenterPoint = ellipseCenter;
                                    insideLighten.CenterColor = Color.White;
                                    insideLighten.SurroundColors = new Color[] { Color.Transparent };
                                    g.FillPath(insideLighten, ellipsePath);
                                }
                            }
                        }
                    }
                }
            }
KryptonOffice2013Renderer.GradientItemColorsTracking