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

DrawRibbonAppButtonGlowUpperBottom() protected method

Internal rendering method.
protected DrawRibbonAppButtonGlowUpperBottom ( Graphics g, MementoRibbonAppButton memento, PaletteState state, Color bottomLight, Color bottomMedium, Color bottomDark ) : void
g System.Drawing.Graphics
memento MementoRibbonAppButton
state PaletteState
bottomLight Color
bottomMedium Color
bottomDark Color
return void
        protected virtual void DrawRibbonAppButtonGlowUpperBottom(Graphics g,
                                                                  MementoRibbonAppButton memento,
                                                                  PaletteState state,
                                                                  Color bottomLight,
                                                                  Color bottomMedium,
                                                                  Color bottomDark)
        {
            int lightTransparency = 50;
            int mediumTransparency = 50;

            if (state == PaletteState.Pressed || state == PaletteState.Tracking)
            {
                lightTransparency = 200;
                mediumTransparency = 200;
            }

            using (LinearGradientBrush brushUpperGlow = new LinearGradientBrush(memento.rectUpperGlow, Color.Transparent, Color.Transparent, LinearGradientMode.Horizontal))
            {
                Color[] colorsUpperGlow = new Color[] { Color.FromArgb(180, bottomDark),
                                                        Color.FromArgb(mediumTransparency, bottomMedium),
                                                        Color.FromArgb(lightTransparency, bottomLight),
                                                        Color.FromArgb(lightTransparency, bottomLight),
                                                        Color.FromArgb(mediumTransparency, bottomMedium),
                                                        Color.FromArgb(180, bottomDark) };

                float[] posUpperGlow = new float[] { 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f };

                ColorBlend blendUpperGlow = new ColorBlend();
                blendUpperGlow.Colors = colorsUpperGlow;
                blendUpperGlow.Positions = posUpperGlow;
                brushUpperGlow.InterpolationColors = blendUpperGlow;

                g.FillPie(brushUpperGlow, memento.rectUpperGlow.X, memento.rectUpperGlow.Y, memento.rectUpperGlow.Width, memento.rectUpperGlow.Height, 180, 180);
            }
        }
RenderStandard