System.Drawing.Drawing2D.GraphicsPath.AddBezier C# (CSharp) Method

AddBezier() public method

public AddBezier ( float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4 ) : void
x1 float
y1 float
x2 float
y2 float
x3 float
y3 float
x4 float
y4 float
return void
        public void AddBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
        {
            Append (x1, y1, PathPointType.Line, true);
            AppendBezier (x2, y2, x3, y3, x4, y4);
        }

Same methods

GraphicsPath::AddBezier ( Point pt1, Point pt2, Point pt3, Point pt4 ) : void
GraphicsPath::AddBezier ( PointF pt1, PointF pt2, PointF pt3, PointF pt4 ) : void
GraphicsPath::AddBezier ( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 ) : void

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Gets the tab path.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <returns>GraphicsPath.</returns>
        private GraphicsPath GetTabPath(int index)
        {
            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            path.Reset();
            Rectangle rect = this.GetTabRect(index);

            switch (Alignment)
            {
            case TabAlignment.Top:

                break;

            case TabAlignment.Bottom:

                break;

            case TabAlignment.Left:

                break;

            case TabAlignment.Right:

                break;
            }
            int PaddingTop = 10;

            Point P_LeftTop     = new Point(rect.Left + 7, rect.Top + PaddingTop);
            Point P_LeftBottom  = new Point(rect.Left + 1, rect.Bottom);
            Point P_RightTop    = new Point(rect.Right - 7, rect.Top + PaddingTop);
            Point P_RightBottom = new Point(rect.Right - 1, rect.Bottom);

            Point P_Control1 = new Point(rect.Left + 3, rect.Top + PaddingTop);
            Point P_Control2 = new Point(rect.Left + 2, rect.Bottom - rect.Height / 2);

            Point P_Control3 = new Point(rect.Right - 3, rect.Top + PaddingTop);
            Point P_Control4 = new Point(rect.Right - 2, rect.Bottom - rect.Height / 2);

            //path.AddLine(rect.Left + 15, rect.Top, rect.Left + 2, rect.Bottom + 1);
            //path.AddLine(rect.Left + 15, rect.Top, rect.Right - 15, rect.Top);
            //path.AddLine(rect.Right - 15, rect.Top, rect.Right - 2, rect.Bottom + 1);
            //path.AddLine(rect.Right - 2, rect.Bottom, rect.Left + 2, rect.Bottom);
            path.AddBezier(P_LeftTop, P_Control1, P_Control2, P_LeftBottom);
            path.AddLine(P_LeftBottom, P_RightBottom);
            path.AddBezier(P_RightBottom, P_Control4, P_Control3, P_RightTop);
            //path.AddBezier(P_RightTop, P_Control3, P_Control4, P_RightBottom);
            path.AddLine(P_RightTop, P_LeftTop);



            //int diameter = 2 * 10;

            //path.AddArc(new Rectangle(new Point(rect.Left + 5, rect.Top), new Size(diameter, diameter)), 180, 60);
            //path.AddArc(new Rectangle(new Point(rect.Right - 15 - diameter, rect.Top - diameter), new Size(diameter, diameter)), 0, 60);
            path.CloseFigure();
            //return GetRoundedRectPath(rect, 15);
            return(path);
        }
All Usage Examples Of System.Drawing.Drawing2D.GraphicsPath::AddBezier