Class Path
Used to create path objects. The path objects may consist of lines, splines or both.
Please see Example_34 and Example_40.
public class Path : IDrawable
- Inheritance
-
Path
- Implements
- Inherited Members
Constructors
Path()
The default constructor.
public Path()
Methods
Add(Point)
Adds a point to this path.
public Path Add(Point point)
Parameters
pointPointthe point to add.
Returns
- Path
this Path object.
DrawOn(Page)
Draws this path on the specified page. If fillShape is set the shape is filled with the stroke color; otherwise the path is stroked with its width, dash pattern, cap style and join style.
public float[] DrawOn(Page page)
Parameters
pagePagethe page to draw this path on.
Returns
- float[]
x and y coordinates of the bottom right corner of this component.
GetLineCapStyle()
Returns the line cap style for this path.
public CapStyle GetLineCapStyle()
Returns
- CapStyle
the line cap style for this path.
GetLineJoinStyle()
Returns the line join style.
public JoinStyle GetLineJoinStyle()
Returns
- JoinStyle
the line join style.
ScaleBy(float)
Scales the points of this path by the specified factor.
public Path ScaleBy(float factor)
Parameters
factorfloatthe factor used to scale the path.
Returns
- Path
this Path object.
SetClosed(bool)
Sets whether a line is drawn from the last point of this path back to the first.
public Path SetClosed(bool closed)
Parameters
closedbooltrue to close the path.
Returns
- Path
this Path object.
SetFillShape(bool)
Sets whether the shape of this path is filled with the stroke color instead of stroked.
public Path SetFillShape(bool fillShape)
Parameters
fillShapebooltrue to fill the shape.
Returns
- Path
this Path object.
SetLineCapStyle(CapStyle)
Sets the line cap style.
public Path SetLineCapStyle(CapStyle style)
Parameters
styleCapStylethe cap style of this path. Supported values: CapStyle.BUTT, CapStyle.ROUND and CapStyle.PROJECTING_SQUARE
Returns
- Path
this Path object.
SetLineJoinStyle(JoinStyle)
Sets the line join style.
public Path SetLineJoinStyle(JoinStyle style)
Parameters
styleJoinStylethe line join style code. Supported values: JoinStyle.MITER, JoinStyle.ROUND and JoinStyle.BEVEL
Returns
- Path
this Path object.
SetLocation(float, float)
Sets the location of this path: its points are drawn offset by x and y.
public Path SetLocation(float x, float y)
Parameters
Returns
- Path
this Path object.
SetStrokeColor(int)
Sets the stroke color that will be used to draw this path. Color.transparent leaves it unchanged.
public Path SetStrokeColor(int color)
Parameters
colorintthe color specified as an integer.
Returns
- Path
this Path object.
SetStrokeColor(float[])
Sets the stroke color that will be used to draw this path.
public Path SetStrokeColor(float[] rgbColor)
Parameters
rgbColorfloat[]the color as red, green and blue components from 0.0 to 1.0.
Returns
- Path
this Path object.
SetStrokeDashPattern(string)
Sets the line dash pattern for this path.
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units.
Examples of line dash patterns:
"[Array] Phase" Appearance Description
_______________ _________________ ____________________________________
"[] 0" ----------------- Solid line
"[3] 0" --- --- --- 3 units on, 3 units off, ...
"[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ...
"[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ...
"[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ...
"[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
public Path SetStrokeDashPattern(string pattern)
Parameters
patternstringthe line dash pattern.
Returns
- Path
this Path object.
SetStrokeWidth(float)
Sets the stroke width that will be used to draw the lines and splines that are part of this path.
public Path SetStrokeWidth(float width)
Parameters
widthfloatthe stroke width.
Returns
- Path
this Path object.