Table of Contents

Class Path

Namespace
iText.Kernel.Geom
Assembly
itext.kernel.dll

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

public class Path
Inheritance
Path
Inherited Members

Remarks

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.

Constructors

Path()

public Path()

Path(IList<Subpath>)

public Path(IList<Subpath> subpaths)

Parameters

subpaths IList<Subpath>

Path(Path)

public Path(Path path)

Parameters

path Path

Methods

AddSubpath(Subpath)

Adds the subpath to this path.

public virtual void AddSubpath(Subpath subpath)

Parameters

subpath Subpath

The subpath to be added to this path.

AddSubpaths<_T0>(IList<_T0>)

Adds the subpaths to this path.

public virtual void AddSubpaths<_T0>(IList<_T0> subpaths) where _T0 : Subpath

Parameters

subpaths IList<_T0>

of subpaths to be added to this path.

Type Parameters

_T0

CloseAllSubpaths()

Closes all subpathes contained in this path.

public virtual void CloseAllSubpaths()

CloseSubpath()

Closes the current subpath.

public virtual void CloseSubpath()

CurveFromTo(float, float, float, float)

Appends a cubic Bezier curve to the current path.

public virtual void CurveFromTo(float x1, float y1, float x3, float y3)

Parameters

x1 float

x-coordinate of the first intermediate control point

y1 float

y-coordinate of the first intermediate control point

x3 float

x-coordinate of the second intermediate control point (and ending point)

y3 float

y-coordinate of the second intermediate control point (and ending point)

Remarks

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

CurveTo(float, float, float, float)

Appends a cubic Bezier curve to the current path.

public virtual void CurveTo(float x2, float y2, float x3, float y3)

Parameters

x2 float

x-coordinate of the second intermediate control point

y2 float

y-coordinate of the second intermediate control point

x3 float

x-coordinate of the ending point

y3 float

y-coordinate of the ending point

Remarks

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

CurveTo(float, float, float, float, float, float)

Appends a cubic Bezier curve to the current path.

public virtual void CurveTo(float x1, float y1, float x2, float y2, float x3, float y3)

Parameters

x1 float

x-coordinate of the first control point

y1 float

y-coordinate of the first control point

x2 float

x-coordinate of the second control point

y2 float

y-coordinate of the second control point

x3 float

x-coordinate of the third control point

y3 float

y-coordinate of the third control point

Remarks

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

GetCurrentPoint()

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

public virtual Point GetCurrentPoint()

Returns

Point

The current point.

GetSubpaths()

public virtual IList<Subpath> GetSubpaths()

Returns

IList<Subpath>

A of subpaths forming this path.

IsEmpty()

Path is empty if it contains no subpaths.

public virtual bool IsEmpty()

Returns

bool

true in case the path is empty and false otherwise

LineTo(float, float)

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

public virtual void LineTo(float x, float y)

Parameters

x float

x-coordinate of the new point

y float

y-coordinate of the new point

MoveTo(float, float)

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

public virtual void MoveTo(float x, float y)

Parameters

x float

x-coordinate of the new point

y float

y-coordinate of the new point

Rectangle(float, float, float, float)

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

public virtual void Rectangle(float x, float y, float w, float h)

Parameters

x float

lower left x-coordinate of the rectangle

y float

lower left y-coordinate of the rectangle

w float

width of the rectangle

h float

height of the rectangle

Rectangle(Rectangle)

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

public virtual void Rectangle(Rectangle rect)

Parameters

rect Rectangle

the rectangle to append to the current path

ReplaceCloseWithLine()

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

public virtual IList<int> ReplaceCloseWithLine()

Returns

IList<int>

Indices of modified subpaths.

Remarks

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