ComponentFactory.Krypton.Toolkit.RenderGlassHelpers.DrawBackGlassBottom C# (CSharp) Method

DrawBackGlassBottom() public static method

Draw a background with glass effect where the fade is from the bottom.
public static DrawBackGlassBottom ( RenderContext context, Rectangle rect, Color backColor1, Color backColor2, VisualOrientation orientation, GraphicsPath path, IDisposable memento ) : IDisposable
context RenderContext Rendering context.
rect System.Drawing.Rectangle Rectangle to draw.
backColor1 Color First color.
backColor2 Color Second color.
orientation VisualOrientation Drawing orientation.
path System.Drawing.Drawing2D.GraphicsPath Clipping path.
memento IDisposable Cache used for drawing.
return IDisposable
        public static IDisposable DrawBackGlassBottom(RenderContext context,
                                                      Rectangle rect,
                                                      Color backColor1,
                                                      Color backColor2,
                                                      VisualOrientation orientation,
                                                      GraphicsPath path,
                                                      IDisposable memento)
        {
            using (Clipping clip = new Clipping(context.Graphics, path))
            {
                MementoDouble cache;

                if ((memento == null) || !(memento is MementoDouble))
                {
                    if (memento != null)
                        memento.Dispose();

                    cache = new MementoDouble();
                    memento = cache;
                }
                else
                    cache = (MementoDouble)memento;

                // Draw the one pixel border around the area
                cache.first = DrawBackLinear(rect, false,
                                             ControlPaint.Light(backColor1),
                                             ControlPaint.LightLight(backColor1),
                                             orientation, context.Graphics,
                                             cache.first);

                // Reduce size on all but the upper edge
                ModifyRectByEdges(ref rect, 1, 0, 1, 1, orientation);

                // Draw the inside areas as a glass effect
                cache.second = DrawBackGlassRadial(rect, backColor1, backColor2,
                                                   _glassColorTopD, _glassColorBottomD,
                                                   3f, 1.1f, orientation, context.Graphics,
                                                   _fullGlassLength, cache.second);
            }

            return memento;
        }