Class PdfBezierCurve
- Namespace
- Syncfusion.Pdf.Graphics
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents Bezier curve shape.
public class PdfBezierCurve : PdfDrawElement
- Inheritance
-
PdfBezierCurve
- Inherited Members
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(0, 0, 100, 50, 50, 50, 100, 100);
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(0, 0, 100, 50, 50, 50, 100, 100)
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
Constructors
PdfBezierCurve()
Initializes a new instance of the PdfBezierCurve class.
protected PdfBezierCurve()
PdfBezierCurve(PointF, PointF, PointF, PointF)
Initializes a new instance of the PdfBezierCurve class with the specified Syncfusion.Drawing.PointF structure
public PdfBezierCurve(PointF startPoint, PointF firstControlPoint, PointF secondControlPoint, PointF endPoint)
Parameters
startPoint
PointFPointF structure that represents the starting point of the curve.
firstControlPoint
PointFPointF structure that represents the first control point for the curve.
secondControlPoint
PointFPointF structure that represents the second control point for the curve.
endPoint
PointFPointF structure that represents the ending point of the curve.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(new PointF(0, 0), new PointF(100, 50), new PointF(50, 50), new PointF(100, 100));
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(New PointF(0, 0), New PointF(100, 50), New PointF(50, 50), New PointF(100, 100))
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
PdfBezierCurve(PdfPen, PointF, PointF, PointF, PointF)
Initializes a new instance of the PdfBezierCurve class with the specified pen and Syncfusion.Drawing.PointF structure.
public PdfBezierCurve(PdfPen pen, PointF startPoint, PointF firstControlPoint, PointF secondControlPoint, PointF endPoint)
Parameters
pen
PdfPenPen that determines the color, width, and style of the curve.
startPoint
PointFPointF structure that represents the starting point of the curve.
firstControlPoint
PointFPointF structure that represents the first control point for the curve.
secondControlPoint
PointFPointF structure that represents the second control point for the curve.
endPoint
PointFPointF structure that represents the ending point of the curve.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, new PointF(0, 0), new PointF(100, 50), new PointF(50, 50), new PointF(100, 100));
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, New PointF(0, 0), New PointF(100, 50), New PointF(50, 50), New PointF(100, 100))
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
PdfBezierCurve(PdfPen, float, float, float, float, float, float, float, float)
Initializes a new instance of the PdfBezierCurve class with the specified pair of coordinates and control points
public PdfBezierCurve(PdfPen pen, float startPointX, float startPointY, float firstControlPointX, float firstControlPointY, float secondControlPointX, float secondControlPointY, float endPointX, float endPointY)
Parameters
pen
PdfPenPen that determines the color, width, and style of the curve.
startPointX
floatThe x-coordinate of the starting point of the curve.
startPointY
floatThe y-coordinate of the starting point of the curve.
firstControlPointX
floatThe x-coordinate of the first control point of the curve.
firstControlPointY
floatThe y-coordinate of the first control point of the curve.
secondControlPointX
floatThe x-coordinate of the second control point of the curve.
secondControlPointY
floatThe y-coordinate of the second control point of the curve.
endPointX
floatThe x-coordinate of the ending point of the curve.
endPointY
floatThe y-coordinate of the ending point of the curve.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, 0, 0, 100, 50, 50, 50, 100, 100);
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, 0, 0, 100, 50, 50, 50, 100, 100)
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
PdfBezierCurve(float, float, float, float, float, float, float, float)
Initializes a new instance of the PdfBezierCurve class with the specified pair of coordinates and control points
public PdfBezierCurve(float startPointX, float startPointY, float firstControlPointX, float firstControlPointY, float secondControlPointX, float secondControlPointY, float endPointX, float endPointY)
Parameters
startPointX
floatThe x-coordinate of the starting point of the curve.
startPointY
floatThe y-coordinate of the starting point of the curve.
firstControlPointX
floatThe x-coordinate of the first control point of the curve.
firstControlPointY
floatThe y-coordinate of the first control point of the curve.
secondControlPointX
floatThe x-coordinate of the second control point of the curve.
secondControlPointY
floatThe y-coordinate of the second control point of the curve.
endPointX
floatThe x-coordinate of the ending point of the curve.
endPointY
floatThe y-coordinate of the ending point of the curve.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(0, 0, 100, 50, 50, 50, 100, 100);
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(0, 0, 100, 50, 50, 50, 100, 100)
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
Properties
EndPoint
Gets or sets the ending point of the curve.
public PointF EndPoint { get; set; }
Property Value
- PointF
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
PointF startPoint = new PointF(0, 0);
PointF firstControlPoint = new PointF(100, 50);
PointF secondControlPoint = new PointF(50, 50);
PointF endPoint = new PointF(100, 100);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint);
//Set start point.
bezier.StartPoint = startPoint;
//Set first control point.
bezier.FirstControlPoint = firstControlPoint;
//Set second control point.
bezier.SecondControlPoint = secondControlPoint;
//Set end point.
bezier.EndPoint = endPoint;
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
Dim startPoint As New PointF(0, 0)
Dim firstControlPoint As New PointF(100, 50)
Dim secondControlPoint As New PointF(50, 50)
Dim endPoint As New PointF(100, 100)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint)
'Set start point.
bezier.StartPoint = startPoint
'Set first control point.
bezier.FirstControlPoint = firstControlPoint
'Set second control point.
bezier.SecondControlPoint = secondControlPoint
'Set end point.
bezier.EndPoint = endPoint
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
FirstControlPoint
Gets or sets the first control point of the curve.
public PointF FirstControlPoint { get; set; }
Property Value
- PointF
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
PointF startPoint = new PointF(0, 0);
PointF firstControlPoint = new PointF(100, 50);
PointF secondControlPoint = new PointF(50, 50);
PointF endPoint = new PointF(100, 100);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint);
//Set start point.
bezier.StartPoint = startPoint;
//Set first control point.
bezier.FirstControlPoint = firstControlPoint;
//Set second control point.
bezier.SecondControlPoint = secondControlPoint;
//Set end point.
bezier.EndPoint = endPoint;
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
Dim startPoint As New PointF(0, 0)
Dim firstControlPoint As New PointF(100, 50)
Dim secondControlPoint As New PointF(50, 50)
Dim endPoint As New PointF(100, 100)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint)
'Set start point.
bezier.StartPoint = startPoint
'Set first control point.
bezier.FirstControlPoint = firstControlPoint
'Set second control point.
bezier.SecondControlPoint = secondControlPoint
'Set end point.
bezier.EndPoint = endPoint
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
SecondControlPoint
Gets or sets the second control point of the curve
public PointF SecondControlPoint { get; set; }
Property Value
- PointF
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
PointF startPoint = new PointF(0, 0);
PointF firstControlPoint = new PointF(100, 50);
PointF secondControlPoint = new PointF(50, 50);
PointF endPoint = new PointF(100, 100);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint);
//Set start point.
bezier.StartPoint = startPoint;
//Set first control point.
bezier.FirstControlPoint = firstControlPoint;
//Set second control point.
bezier.SecondControlPoint = secondControlPoint;
//Set end point.
bezier.EndPoint = endPoint;
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
Dim startPoint As New PointF(0, 0)
Dim firstControlPoint As New PointF(100, 50)
Dim secondControlPoint As New PointF(50, 50)
Dim endPoint As New PointF(100, 100)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint)
'Set start point.
bezier.StartPoint = startPoint
'Set first control point.
bezier.FirstControlPoint = firstControlPoint
'Set second control point.
bezier.SecondControlPoint = secondControlPoint
'Set end point.
bezier.EndPoint = endPoint
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
StartPoint
Gets or sets the starting point of the curve
public PointF StartPoint { get; set; }
Property Value
- PointF
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a new PDF page.
PdfPage page = document.Pages.Add();
//Create new PDF Pen.
PdfPen pen = new PdfPen(Color.Red);
PointF startPoint = new PointF(0, 0);
PointF firstControlPoint = new PointF(100, 50);
PointF secondControlPoint = new PointF(50, 50);
PointF endPoint = new PointF(100, 100);
//Create new instance of PdfBezierCurve.
PdfBezierCurve bezier = new PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint);
//Set start point.
bezier.StartPoint = startPoint;
//Set first control point.
bezier.FirstControlPoint = firstControlPoint;
//Set second control point.
bezier.SecondControlPoint = secondControlPoint;
//Set end point.
bezier.EndPoint = endPoint;
//Draw the bezier curve to PDF page.
bezier.Draw(page, new PointF(300, 200));
//Save the PDF docment.
document.Save("output.pdf");
//Close the PDF document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Add a new PDF page.
Dim page As PdfPage = document.Pages.Add()
'Create new PDF Pen.
Dim pen As New PdfPen(Color.Red)
Dim startPoint As New PointF(0, 0)
Dim firstControlPoint As New PointF(100, 50)
Dim secondControlPoint As New PointF(50, 50)
Dim endPoint As New PointF(100, 100)
'Create new instance of PdfBezierCurve.
Dim bezier As New PdfBezierCurve(pen, startPoint, firstControlPoint, secondControlPoint, endPoint)
'Set start point.
bezier.StartPoint = startPoint
'Set first control point.
bezier.FirstControlPoint = firstControlPoint
'Set second control point.
bezier.SecondControlPoint = secondControlPoint
'Set end point.
bezier.EndPoint = endPoint
'Draw the bezier curve to PDF page.
bezier.Draw(page, New PointF(300, 200))
'Save the PDF docment.
document.Save("output.pdf")
'Close the PDF document.
document.Close(True)
Methods
DrawInternal(PdfGraphics)
Draws an element on the Graphics.
protected override void DrawInternal(PdfGraphics graphics)
Parameters
graphics
PdfGraphicsGraphics context where the element should be printed.
GetBoundsInternal()
Overloaded. Returns a rectangle that bounds this element.
protected override RectangleF GetBoundsInternal()
Returns
- RectangleF
Returns a rectangle that bounds this element.