protected virtual void DrawRibbonTabGlowingLeft(Rectangle rect,
Color c1, Color c2, Color insideColor,
MementoRibbonTabGlowing cache)
{
GraphicsPath outsidePath = new GraphicsPath();
GraphicsPath topPath = new GraphicsPath();
GraphicsPath ellipsePath = new GraphicsPath();
// Create path for a curved border around the tab
outsidePath.AddLine(rect.Right - 2, rect.Bottom - 1, rect.Left + 1.5f, rect.Bottom - 1);
outsidePath.AddLine(rect.Left + 1.5f, rect.Bottom - 1, rect.Left, rect.Bottom - 3);
outsidePath.AddLine(rect.Left, rect.Bottom - 3, rect.Left, rect.Top + 3);
outsidePath.AddLine(rect.Left, rect.Top + 3, rect.Left + 1.5f, rect.Top + 1);
outsidePath.AddLine(rect.Left + 1.5f, rect.Top + 1, rect.Right - 2, rect.Top + 1);
// Create path for the top glassy effect
int q4 = rect.Height / 4;
topPath.AddLine(rect.Left + 1, rect.Bottom - 2, rect.Left + 2, rect.Bottom - 1);
topPath.AddLine(rect.Left + 2, rect.Bottom - 1, rect.Left + 2 + q4, rect.Bottom - 1);
topPath.AddLine(rect.Left + 2 + q4, rect.Bottom - 1, rect.Left + 5 + q4, rect.Bottom - 4);
topPath.AddLine(rect.Left + 5 + q4, rect.Bottom - 4, rect.Left + 5 + q4, rect.Top + 4);
topPath.AddLine(rect.Left + 5 + q4, rect.Top + 4, rect.Left + 2 + q4 , rect.Top + 1);
topPath.AddLine(rect.Left + 2 + q4, rect.Top + 1, rect.Left + 2, rect.Top + 2);
topPath.AddLine(rect.Left + 2, rect.Top + 2, rect.Left + 1, rect.Top + 2);
RectangleF topRectF = new RectangleF(rect.Left, rect.Top, q4 + 5, rect.Height);
cache.topBrush = new LinearGradientBrush(topRectF, c1, Color.Transparent, 0f);
int ellipseWidth = (int)(rect.Width * 0.4f);
int ellipseHeight = (int)(rect.Height * 1.2f);
cache.fullRect = new RectangleF(rect.Left + 1, rect.Top + 2, rect.Width - 2, rect.Height - 3);
cache.ellipseRect = new RectangleF(rect.Right - ellipseWidth, rect.Top - ((ellipseHeight - rect.Height) / 2), ellipseWidth * 2, ellipseHeight);
// Cannot draw a path that contains a zero sized element
if ((cache.ellipseRect.Width > 0) && (cache.ellipseRect.Height > 0))
{
ellipsePath.AddEllipse(cache.ellipseRect);
cache.ellipseBrush = new PathGradientBrush(ellipsePath);
cache.ellipseBrush.CenterColor = c2;
PointF centerPoint = new PointF(cache.ellipseRect.Left + (cache.ellipseRect.Width / 2), cache.ellipseRect.Top + (cache.ellipseRect.Height / 2));
cache.ellipseBrush.CenterPoint = centerPoint;
cache.ellipseBrush.SurroundColors = new Color[] { Color.Transparent };
}
cache.insideBrush = new SolidBrush(insideColor);
cache.insidePen = new Pen(insideColor);
cache.outsidePen = new Pen(c1);
cache.outsidePath = outsidePath;
cache.topPath = topPath;
cache.ellipsePath = ellipsePath;
}