Skip to main content
All docs
V26.1
  • BezierGraphicsPathSegment Class

    A cubic Bezier curve segment of a graphics path.

    Namespace: DevExpress.Docs.Pdf

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

    Declaration

    public class BezierGraphicsPathSegment :
        GraphicsPathSegment

    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));
    }
    

    Implements

    Inheritance

    Object
    GraphicsPathSegment
    BezierGraphicsPathSegment
    See Also