protected virtual void DrawRibbonTabTrackingTop2007(Rectangle rect,
Color c1, Color c2,
MementoRibbonTabTracking2007 cache)
{
GraphicsPath outsidePath = new GraphicsPath();
GraphicsPath topPath = new GraphicsPath();
GraphicsPath ellipsePath = new GraphicsPath();
RectangleF half1RectF, vertRectF, horzRectF;
int full, half1, half2;
Rectangle fullRect;
// Create path for a curved border around the tab
outsidePath.AddLine(rect.Left + 1, rect.Bottom - 2, rect.Left + 1, rect.Top + 1.5f);
outsidePath.AddLine(rect.Left + 1, rect.Top + 1.5f, rect.Left + 3, rect.Top);
outsidePath.AddLine(rect.Left + 3, rect.Top, rect.Right - 4, rect.Top);
outsidePath.AddLine(rect.Right - 4, rect.Top, rect.Right - 2, rect.Top + 1.5f);
outsidePath.AddLine(rect.Right - 2, rect.Top + 1.5f, rect.Right - 2, rect.Bottom - 2);
// Create path for the top hightlight line
topPath.AddLine(rect.Left + 3, rect.Top + 2, rect.Left + 4, rect.Top + 1);
topPath.AddLine(rect.Left + 4, rect.Top + 1, rect.Right - 5, rect.Top + 1);
topPath.AddLine(rect.Right - 5, rect.Top + 1, rect.Right - 4, rect.Top + 2);
// Create the top and bottom half rectangles
full = rect.Height - 3;
half1 = full / 2;
half2 = full - half1;
cache.half1Rect = new Rectangle(rect.Left + 3, rect.Top + 2, rect.Width - 6, half1);
cache.half2Rect = new Rectangle(rect.Left + 3, rect.Top + 2 + half1, rect.Width - 6, half2);
fullRect = new Rectangle(rect.Left + 3, rect.Top + 2, rect.Width - 6, half1 + half2);
half1RectF = new RectangleF(cache.half1Rect.Left - 1, cache.half1Rect.Top - 0.5f, cache.half1Rect.Width + 2, cache.half1Rect.Height + 1);
cache.half2RectF = new RectangleF(cache.half2Rect.Left - 1, cache.half2Rect.Top - 0.5f, cache.half2Rect.Width + 2, cache.half2Rect.Height + 1);
cache.half1LeftBrush = new LinearGradientBrush(half1RectF, Color.FromArgb(85, c2), Color.Transparent, 0f);
cache.half1LeftBrush.Blend = _ribbonTabTopBlend;
cache.half1RightBrush = new LinearGradientBrush(half1RectF, Color.FromArgb(85, c2), Color.Transparent, 180f);
cache.half1RightBrush.Blend = _ribbonTabTopBlend;
cache.half1LightBrush = new LinearGradientBrush(half1RectF, Color.FromArgb(28, Color.White), Color.FromArgb(125, Color.White), 90f);
cache.half2Brush = new SolidBrush(Color.FromArgb(85, c2));
// Create ellipse information for lightening the bottom half
cache.ellipseRect = new RectangleF(fullRect.Left - (fullRect.Width / 8), fullRect.Top, fullRect.Width * 1.25f, fullRect.Height);
// 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 = Color.FromArgb(92, Color.White);
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 };
}
vertRectF = new RectangleF(rect.Left - 1, rect.Top + 2, rect.Width + 2, rect.Height - 2);
horzRectF = new RectangleF(rect.Left + 1, rect.Top, rect.Width - 2, rect.Height);
cache.outsideBrush = new LinearGradientBrush(vertRectF, Color.Transparent, _whiten128, 90f);
cache.outsideBrush.Blend = _ribbonOutBlend;
cache.insideBrush = new LinearGradientBrush(vertRectF, Color.Transparent, _whiten200, 90f);
cache.insideBrush.Blend = _ribbonInBlend;
cache.topBrush = new LinearGradientBrush(horzRectF, _whiten92, _whiten128, 0f);
cache.topBrush.Blend = _ribbonTopBlend;
cache.topPen = new Pen(cache.topBrush);
cache.outsidePen = new Pen(c1);
cache.outsidePath = outsidePath;
cache.topPath = topPath;
cache.ellipsePath = ellipsePath;
}