Class Path
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
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
SubpathThe 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
floatx-coordinate of the first intermediate control point
y1
floaty-coordinate of the first intermediate control point
x3
floatx-coordinate of the second intermediate control point (and ending point)
y3
floaty-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
floatx-coordinate of the second intermediate control point
y2
floaty-coordinate of the second intermediate control point
x3
floatx-coordinate of the ending point
y3
floaty-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
floatx-coordinate of the first control point
y1
floaty-coordinate of the first control point
x2
floatx-coordinate of the second control point
y2
floaty-coordinate of the second control point
x3
floatx-coordinate of the third control point
y3
floaty-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
IsEmpty()
Path is empty if it contains no subpaths.
public virtual bool IsEmpty()
Returns
- bool
true
in case the path is empty andfalse
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
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
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
floatlower left x-coordinate of the rectangle
y
floatlower left y-coordinate of the rectangle
w
floatwidth of the rectangle
h
floatheight of the rectangle
Rectangle(Rectangle)
Appends a rectangle to the current path as a complete subpath.
public virtual void Rectangle(Rectangle rect)
Parameters
rect
Rectanglethe 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
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.