iText 9.0.0 API
iText.Kernel.Geom.Path Class Reference

Paths define shapes, trajectories, and regions of all sorts. More...

Public Member Functions

  Path (IList< Subpath > subpaths)
 
  Path (iText.Kernel.Geom.Path path)
 
virtual IList< Subpath GetSubpaths ()
 
virtual void  AddSubpath (Subpath subpath)
  Adds the subpath to this path. More...
 
virtual void  AddSubpaths< _T0 > (IList< _T0 > subpaths)
  Adds the subpaths to this path. More...
 
virtual Point  GetCurrentPoint ()
  The current point is the trailing endpoint of the segment most recently added to the current path. More...
 
virtual void  MoveTo (float x, float y)
  Begins a new subpath by moving the current point to coordinates (x, y). More...
 
virtual void  LineTo (float x, float y)
  Appends a straight line segment from the current point to the point (x, y). More...
 
virtual void  CurveTo (float x1, float y1, float x2, float y2, float x3, float y3)
  Appends a cubic Bezier curve to the current path. More...
 
virtual void  CurveTo (float x2, float y2, float x3, float y3)
  Appends a cubic Bezier curve to the current path. More...
 
virtual void  CurveFromTo (float x1, float y1, float x3, float y3)
  Appends a cubic Bezier curve to the current path. More...
 
virtual void  Rectangle (iText.Kernel.Geom.Rectangle rect)
  Appends a rectangle to the current path as a complete subpath. More...
 
virtual void  Rectangle (float x, float y, float w, float h)
  Appends a rectangle to the current path as a complete subpath. More...
 
virtual void  CloseSubpath ()
  Closes the current subpath. More...
 
virtual void  CloseAllSubpaths ()
  Closes all subpathes contained in this path. More...
 
virtual IList< int >  ReplaceCloseWithLine ()
  Adds additional line to each closed subpath and makes the subpath unclosed. More...
 
virtual bool  IsEmpty ()
  Path is empty if it contains no subpaths. More...
 

Detailed Description

Paths define shapes, trajectories, and regions of all sorts.

Paths define shapes, trajectories, and regions of all sorts. They shall be used to draw lines, define the shapes of filled areas, and specify boundaries for clipping other graphics. A path shall be composed of straight and curved line segments, which may connect to one another or may be disconnected.

Member Function Documentation

◆ AddSubpath()

virtual void iText.Kernel.Geom.Path.AddSubpath ( Subpath  subpath )
inlinevirtual

Adds the subpath to this path.

Parameters
subpath The subpath to be added to this path.

◆ AddSubpaths< _T0 >()

virtual void iText.Kernel.Geom.Path.AddSubpaths< _T0 > ( IList< _T0 >  subpaths )
inlinevirtual

Adds the subpaths to this path.

Parameters
subpaths

System.Collections.IList of subpaths to be added to this path.

Type Constraints
_T0  : Subpath  

◆ CloseAllSubpaths()

virtual void iText.Kernel.Geom.Path.CloseAllSubpaths ( )
inlinevirtual

Closes all subpathes contained in this path.

◆ CloseSubpath()

virtual void iText.Kernel.Geom.Path.CloseSubpath ( )
inlinevirtual

Closes the current subpath.

◆ CurveFromTo()

virtual void iText.Kernel.Geom.Path.CurveFromTo ( float  x1,
float  y1,
float  x3,
float  y3 
)
inlinevirtual

Appends a cubic Bezier curve to the current path.

Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3) using (x1, y1) and (x3, y3) as control points. Note that (x3, y3) is used both as both a control point and an ending point

Parameters
x1 x-coordinate of the first intermediate control point
y1 y-coordinate of the first intermediate control point
x3 x-coordinate of the second intermediate control point (and ending point)
y3 y-coordinate of the second intermediate control point (and ending point)

◆ CurveTo() [1/2]

virtual void iText.Kernel.Geom.Path.CurveTo ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)
inlinevirtual

Appends a cubic Bezier curve to the current path.

Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3).

Parameters
x1 x-coordinate of the first control point
y1 y-coordinate of the first control point
x2 x-coordinate of the second control point
y2 y-coordinate of the second control point
x3 x-coordinate of the third control point
y3 y-coordinate of the third control point

◆ CurveTo() [2/2]

virtual void iText.Kernel.Geom.Path.CurveTo ( float  x2,
float  y2,
float  x3,
float  y3 
)
inlinevirtual

Appends a cubic Bezier curve to the current path.

Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3) using the current point and (x2, y2) as intermediate control points. Note that current point is both used as the starting point and a control point

Parameters
x2 x-coordinate of the second intermediate control point
y2 y-coordinate of the second intermediate control point
x3 x-coordinate of the ending point
y3 y-coordinate of the ending point

◆ GetCurrentPoint()

virtual Point iText.Kernel.Geom.Path.GetCurrentPoint ( )
inlinevirtual

The current point is the trailing endpoint of the segment most recently added to the current path.

Returns
The current point.

◆ GetSubpaths()

virtual IList<Subpath> iText.Kernel.Geom.Path.GetSubpaths ( )
inlinevirtual
Returns
A System.Collections.IList of subpaths forming this path.

◆ IsEmpty()

virtual bool iText.Kernel.Geom.Path.IsEmpty ( )
inlinevirtual

Path is empty if it contains no subpaths.

Returns
true in case the path is empty and false otherwise

◆ LineTo()

virtual void iText.Kernel.Geom.Path.LineTo ( float  x,
float  y 
)
inlinevirtual

Appends a straight line segment from the current point to the point (x, y).

Parameters
x x-coordinate of the new point
y y-coordinate of the new point

◆ MoveTo()

virtual void iText.Kernel.Geom.Path.MoveTo ( float  x,
float  y 
)
inlinevirtual

Begins a new subpath by moving the current point to coordinates (x, y).

Parameters
x x-coordinate of the new point
y y-coordinate of the new point

◆ Rectangle() [1/2]

virtual void iText.Kernel.Geom.Path.Rectangle ( float  x,
float  y,
float  w,
float  h 
)
inlinevirtual

Appends a rectangle to the current path as a complete subpath.

Parameters
x lower left x-coordinate of the rectangle
y lower left y-coordinate of the rectangle
w width of the rectangle
h height of the rectangle

◆ Rectangle() [2/2]

virtual void iText.Kernel.Geom.Path.Rectangle ( iText.Kernel.Geom.Rectangle  rect )
inlinevirtual

Appends a rectangle to the current path as a complete subpath.

Parameters
rect the rectangle to append to the current path

◆ ReplaceCloseWithLine()

virtual IList iText.Kernel.Geom.Path.ReplaceCloseWithLine ( )
inlinevirtual

Adds additional line to each closed subpath and makes the subpath unclosed.

Adds additional line to each closed subpath and makes the subpath unclosed. The line connects the last and the first points of the subpaths.

Returns
Indices of modified subpaths.