public override void CloseCurve(GraphPane pane, CurveItem curve, PointF[] arrPoints, int count, double yMin, System.Drawing.Drawing2D.GraphicsPath path) { if(pane.LineType == LineType.Stack) throw new NotSupportedException("Filled lines cannot be stacked"); FilledLineItem filledCurve = curve as FilledLineItem; if(filledCurve == null) throw new ArgumentException("Curve was of the wrong type. Expected FilledLineItem but was " + curve.GetType(), "curve"); // Build another points array consisting of the low points (It gets these from the LowerPoints property of the curve) PointF[] arrPoints2; int count2; BuildLowPointsArray(pane, curve, out arrPoints2, out count2); // Add the new points to the GraphicsPath float tension = _isSmooth ? _smoothTension : 0f; path.AddCurve(arrPoints2, 0, count2 - 2, tension); }
public override void AddTabBorder(System.Drawing.Drawing2D.GraphicsPath path, System.Drawing.Rectangle tabBounds) { int spread; int eigth; int sixth; int quarter; if (this._TabControl.Alignment <= TabAlignment.Bottom){ spread = (int)Math.Floor((decimal)tabBounds.Height * 2/3); eigth = (int)Math.Floor((decimal)tabBounds.Height * 1/8); sixth = (int)Math.Floor((decimal)tabBounds.Height * 1/6); quarter = (int)Math.Floor((decimal)tabBounds.Height * 1/4); } else { spread = (int)Math.Floor((decimal)tabBounds.Width * 2/3); eigth = (int)Math.Floor((decimal)tabBounds.Width * 1/8); sixth = (int)Math.Floor((decimal)tabBounds.Width * 1/6); quarter = (int)Math.Floor((decimal)tabBounds.Width * 1/4); } switch (this._TabControl.Alignment) { case TabAlignment.Top: path.AddCurve(new Point[] { new Point(tabBounds.X, tabBounds.Bottom) ,new Point(tabBounds.X + sixth, tabBounds.Bottom - eigth) ,new Point(tabBounds.X + spread - quarter, tabBounds.Y + eigth) ,new Point(tabBounds.X + spread, tabBounds.Y)}); path.AddLine(tabBounds.X + spread, tabBounds.Y, tabBounds.Right - spread, tabBounds.Y); path.AddCurve(new Point[] { new Point(tabBounds.Right - spread, tabBounds.Y) ,new Point(tabBounds.Right - spread + quarter, tabBounds.Y + eigth) ,new Point(tabBounds.Right - sixth, tabBounds.Bottom - eigth) ,new Point(tabBounds.Right, tabBounds.Bottom)}); break; case TabAlignment.Bottom: path.AddCurve(new Point[] { new Point(tabBounds.Right, tabBounds.Y) ,new Point(tabBounds.Right - sixth, tabBounds.Y + eigth) ,new Point(tabBounds.Right - spread + quarter, tabBounds.Bottom - eigth) ,new Point(tabBounds.Right - spread, tabBounds.Bottom)}); path.AddLine(tabBounds.Right - spread, tabBounds.Bottom, tabBounds.X + spread, tabBounds.Bottom); path.AddCurve(new Point[] { new Point(tabBounds.X + spread, tabBounds.Bottom) ,new Point(tabBounds.X + spread - quarter, tabBounds.Bottom - eigth) ,new Point(tabBounds.X + sixth, tabBounds.Y + eigth) ,new Point(tabBounds.X, tabBounds.Y)}); break; case TabAlignment.Left: path.AddCurve(new Point[] { new Point(tabBounds.Right, tabBounds.Bottom) ,new Point(tabBounds.Right - eigth, tabBounds.Bottom - sixth) ,new Point(tabBounds.X + eigth, tabBounds.Bottom - spread + quarter) ,new Point(tabBounds.X, tabBounds.Bottom - spread)}); path.AddLine(tabBounds.X, tabBounds.Bottom - spread, tabBounds.X ,tabBounds.Y + spread); path.AddCurve(new Point[] { new Point(tabBounds.X, tabBounds.Y + spread) ,new Point(tabBounds.X + eigth, tabBounds.Y + spread - quarter) ,new Point(tabBounds.Right - eigth, tabBounds.Y + sixth) ,new Point(tabBounds.Right, tabBounds.Y)}); break; case TabAlignment.Right: path.AddCurve(new Point[] { new Point(tabBounds.X, tabBounds.Y) ,new Point(tabBounds.X + eigth, tabBounds.Y + sixth) ,new Point(tabBounds.Right - eigth, tabBounds.Y + spread - quarter) ,new Point(tabBounds.Right, tabBounds.Y + spread)}); path.AddLine(tabBounds.Right, tabBounds.Y + spread, tabBounds.Right, tabBounds.Bottom - spread); path.AddCurve(new Point[] { new Point(tabBounds.Right, tabBounds.Bottom - spread) ,new Point(tabBounds.Right - eigth, tabBounds.Bottom - spread + quarter) ,new Point(tabBounds.X + eigth, tabBounds.Bottom - sixth) ,new Point(tabBounds.X, tabBounds.Bottom)}); break; } }