Skip to main content
All docs
V26.1
  • GraphicsPath.AppendBezierSegment(PointF, PointF, PointF) Method

    Appends a cubic Bezier curve segment to the path.

    Namespace: DevExpress.Docs.Pdf

    Assembly: DevExpress.Docs.Pdf.v26.1.dll

    Declaration

    public void AppendBezierSegment(
        PointF controlPoint1,
        PointF controlPoint2,
        PointF endPoint
    )

    Parameters

    Name Type Description
    controlPoint1 PointF

    The first control point of the Bezier curve.

    controlPoint2 PointF

    The second control point of the Bezier curve.

    endPoint PointF

    The end point of the Bezier curve.

    Example

    How to: Add a Bezier Curve to a Page

    The following code snippet adds an oval to the page:

    using DevExpress.Docs.Pdf;
    using DevExpress.Drawing;
    using DevExpress.Drawing.Printing;
    using System.Drawing;
    using System.IO;
    
    using (PdfDocument pdfDocument = new PdfDocument())
    {
        var page = pdfDocument.Pages.Add(DXPaperKind.A4);
    
        GraphicsPath bezier = new GraphicsPath(new PointF(210, 375));
        bezier.AppendBezierSegment(new PointF(210, 320), 
            new PointF(350, 320), new PointF(350, 375));
        bezier.AppendBezierSegment(new PointF(350, 430), 
            new PointF(210, 430), new PointF(210, 375));
    
        page.AddPathFragment(new PathFragment
        {
            Paths = { bezier },
            Pen = new DXPen(Color.Black, 1),
            Brush = new DXSolidBrush(Color.Red),
            Action = PathShapeAction.FillAndStroke
        });
    
        pdfDocument.Save(new FileStream(@"C:\Test Documents\Document_upd.pdf", 
            FileMode.Create, FileAccess.Write));
    }
    
    See Also