ComponentFactory.Krypton.Toolkit.RenderStandard.DrawRibbonAppButtonGlowCenter C# (CSharp) Method

DrawRibbonAppButtonGlowCenter() protected method

Internal rendering method.
protected DrawRibbonAppButtonGlowCenter ( Graphics g, MementoRibbonAppButton memento, PaletteState state, Color topLight, Color bottomLight ) : void
g System.Drawing.Graphics
memento MementoRibbonAppButton
state PaletteState
topLight Color
bottomLight Color
return void
        protected virtual void DrawRibbonAppButtonGlowCenter(Graphics g,
                                                             MementoRibbonAppButton memento,
                                                             PaletteState state,
                                                             Color topLight,
                                                             Color bottomLight)
        {
            using (LinearGradientBrush brushBottomGlow = new LinearGradientBrush(memento.rectBottomGlow, Color.FromArgb(50, Color.White), Color.FromArgb(30, Color.White), LinearGradientMode.Vertical))
            {
                RectangleF rectBottomGlow = memento.rectBottomGlow;
                rectBottomGlow.X = memento.rect.X + (memento.rect.Width - rectBottomGlow.Width) / 2;
                rectBottomGlow.Y = memento.rect.Y + (memento.rect.Height - rectBottomGlow.Height - 2);

                if (state != PaletteState.Pressed)
                    g.FillPie(brushBottomGlow, rectBottomGlow.X, rectBottomGlow.Y, rectBottomGlow.Width, rectBottomGlow.Height, 0, 360);

                if (state == PaletteState.Pressed)
                {
                    rectBottomGlow.Height = memento.rect.Height * 0.2f;
                    rectBottomGlow.Width = memento.rect.Width * 0.4f;
                    rectBottomGlow.X = memento.rect.X + (memento.rect.Width - rectBottomGlow.Width) / 2;
                    rectBottomGlow.Y = memento.rect.Y + (memento.rect.Height - rectBottomGlow.Height);

                    using (GraphicsPath path = new GraphicsPath())
                    {
                        path.AddEllipse(rectBottomGlow);
                        using (PathGradientBrush pathGradient = new PathGradientBrush(path))
                        {
                            pathGradient.CenterColor = topLight;
                            pathGradient.SurroundColors = new Color[] { Color.FromArgb(100, bottomLight) };
                            g.FillEllipse(pathGradient, rectBottomGlow);
                        }
                    }
                }
            }
        }
RenderStandard