VectSharp 2.6.1
A light library for C# vector graphics
|
Represents a graphics path that can be filled or stroked. More...
Public Member Functions | |
GraphicsPath | MoveTo (Point p) |
Move the current point without tracing a segment from the previous point. More... | |
GraphicsPath | MoveTo (double x, double y) |
Move the current point without tracing a segment from the previous point. More... | |
GraphicsPath | LineTo (Point p) |
Move the current point and trace a segment from the previous point. More... | |
GraphicsPath | LineTo (double x, double y) |
Move the current point and trace a segment from the previous point. More... | |
GraphicsPath | Arc (Point center, double radius, double startAngle, double endAngle) |
Trace an arc segment from a circle with the specified center and radius , starting at startAngle and ending at endAngle . The current point is updated to the end point of the arc. More... | |
GraphicsPath | Arc (double centerX, double centerY, double radius, double startAngle, double endAngle) |
Trace an arc segment from a circle with the specified center and radius , starting at startAngle and ending at endAngle . The current point is updated to the end point of the arc. More... | |
GraphicsPath | EllipticalArc (double radiusX, double radiusY, double axisAngle, bool largeArc, bool sweepClockwise, Point endPoint) |
Trace an arc from an ellipse with the specified radii, rotated by axisAngle with respect to the x-axis, starting at the current point and ending at the endPoint . More... | |
GraphicsPath | CubicBezierTo (Point control1, Point control2, Point endPoint) |
Trace a cubic Bezier curve from the current point to a destination point, with two control points. The current point is updated to the end point of the Bezier curve. More... | |
GraphicsPath | CubicBezierTo (double control1X, double control1Y, double control2X, double control2Y, double endPointX, double endPointY) |
Trace a cubic Bezier curve from the current point to a destination point, with two control points. The current point is updated to the end point of the Bezier curve. More... | |
GraphicsPath | QuadraticBezierTo (Point control, Point endPoint) |
Trace a quadratic Bezier curve from the current point to a destination point, with a single control point. The current point is updated to the end point of the Bezier curve. More... | |
GraphicsPath | QuadraticBezierTo (double controlX, double controlY, double endPointX, double endPointY) |
Trace a quadratic Bezier curve from the current point to a destination point, with a single control point. The current point is updated to the end point of the Bezier curve. More... | |
GraphicsPath | Close () |
Trace a segment from the current point to the start point of the figure and flag the figure as closed. More... | |
GraphicsPath | AddText (double originX, double originY, string text, Font font, TextBaselines textBaseline=TextBaselines.Top) |
Add the contour of a text string to the current path. More... | |
GraphicsPath | AddText (Point origin, string text, Font font, TextBaselines textBaseline=TextBaselines.Top) |
Add the contour of a text string to the current path. More... | |
GraphicsPath | AddTextOnPath (GraphicsPath path, string text, Font font, double reference=0, TextAnchors anchor=TextAnchors.Left, TextBaselines textBaseline=TextBaselines.Top) |
Add the contour of a text string flowing along a GraphicsPath to the current path. More... | |
GraphicsPath | AddTextUnderline (Point origin, string text, Font font, TextBaselines textBaseline=TextBaselines.Top) |
Add the contour of the underline of the specified text string to the current path. More... | |
GraphicsPath | AddSmoothSpline (params Point[] points) |
Adds a smooth spline composed of cubic bezier segments that pass through the specified points. More... | |
GraphicsPath | AddPath (GraphicsPath path) |
Adds another GraphicsPath to the current GraphicsPath. More... | |
double | MeasureLength () |
Measures the length of the GraphicsPath. More... | |
Point | GetPointAtRelative (double position) |
Gets the point at the relative position specified on the GraphicsPath. More... | |
Point | GetPointAtAbsolute (double length) |
Gets the point at the absolute position specified on the GraphicsPath. More... | |
Point | GetTangentAtRelative (double position) |
Gets the tangent to the point at the relative position specified on the GraphicsPath. More... | |
Point | GetTangentAtAbsolute (double length) |
Gets the tangent to the point at the absolute position specified on the GraphicsPath. More... | |
Point | GetNormalAtAbsolute (double length) |
Gets the normal to the point at the absolute position specified on the GraphicsPath. More... | |
Point | GetNormalAtRelative (double position) |
Gets the normal to the point at the relative position specified on the GraphicsPath. More... | |
GraphicsPath | Linearise (double resolution) |
Linearises a GraphicsPath, replacing curve segments with series of line segments that approximate them. More... | |
GraphicsPath | Discretise (double resolution) |
Discretises a GraphicsPath, replacing curve segments with series of line segments that approximate them and ensuring that all line segments are shorter than the specified resolution . More... | |
GraphicsPath | Flatten (double flatness) |
Flattens a GraphicsPath, replacing curve segments with series of line segments that approximate them, ensuring the specified maximum deviation from the original path. More... | |
IEnumerable< List< Point > > | GetPoints () |
Gets a collection of the end points of all the segments in the GraphicsPath, divided by figure. More... | |
IEnumerable< GraphicsPath > | GetFigures () |
Gets a collection of all the figures in the GraphicsPath, returned as individual GraphicsPaths. More... | |
IEnumerable< List< Point > > | GetLinearisationPointsNormals (double resolution) |
Gets a collection of the tangents at the end point of the segments in which the GraphicsPath would be linearised, divided by figure. More... | |
IEnumerable< GraphicsPath > | Triangulate (double resolution, bool clockwise) |
Divides a GraphicsPath into triangles. More... | |
GraphicsPath | Transform (Func< Point, Point > transformationFunction) |
Transforms all of the Points in the GraphicsPath with an arbitrary transformation function. More... | |
Rectangle | GetBounds () |
Compute the rectangular bounds of the path. More... | |
GraphicsPath | Reverse () |
Reverses the GraphicsPath. More... | |
GraphicsPath | GetStroke (double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter) |
Returns a GraphicsPath representing the stroke of the current GraphicsPath. More... | |
bool | ContainsPoint (Point point, FillRule fillRule) |
Determines whether the specified point falls within the current GraphicsPath. More... | |
Properties | |
List< Segment > | Segments = new List<Segment>() [get, set] |
The segments that make up the path. More... | |
Represents a graphics path that can be filled or stroked.
Definition at line 28 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddPath | ( | GraphicsPath | path | ) |
Adds another GraphicsPath to the current GraphicsPath.
path | The existing GraphicsPath that should be added to the current GraphicsPath. |
Definition at line 1210 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddSmoothSpline | ( | params Point[] | points | ) |
Adds a smooth spline composed of cubic bezier segments that pass through the specified points.
points | The points through which the spline should pass. |
Definition at line 1178 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddText | ( | double | originX, |
double | originY, | ||
string | text, | ||
Font | font, | ||
TextBaselines | textBaseline = TextBaselines.Top |
||
) |
Add the contour of a text string to the current path.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
textBaseline | The text baseline (determines what originY represents). |
///
Definition at line 358 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddText | ( | Point | origin, |
string | text, | ||
Font | font, | ||
TextBaselines | textBaseline = TextBaselines.Top |
||
) |
Add the contour of a text string to the current path.
origin | The text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
Definition at line 371 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddTextOnPath | ( | GraphicsPath | path, |
string | text, | ||
Font | font, | ||
double | reference = 0 , |
||
TextAnchors | anchor = TextAnchors.Left , |
||
TextBaselines | textBaseline = TextBaselines.Top |
||
) |
Add the contour of a text string flowing along a GraphicsPath to the current path.
path | The GraphicsPath along which the text will flow. |
text | The string to draw. |
font | The font with which to draw the text. |
reference | The (relative) starting point on the path starting from which the text should be drawn (0 is the start of the path, 1 is the end of the path). |
anchor | The anchor in the text string that will correspond to the point specified by the reference . |
textBaseline | The text baseline (determines which the position of the text in relation to the path . |
Definition at line 476 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.AddTextUnderline | ( | Point | origin, |
string | text, | ||
Font | font, | ||
TextBaselines | textBaseline = TextBaselines.Top |
||
) |
Add the contour of the underline of the specified text string to the current path.
origin | The text origin. See textBaseline . |
text | The string whose underline will be drawn. |
font | The font with which to draw the text. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
Definition at line 624 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Arc | ( | double | centerX, |
double | centerY, | ||
double | radius, | ||
double | startAngle, | ||
double | endAngle | ||
) |
Trace an arc segment from a circle with the specified center and radius , starting at startAngle and ending at endAngle . The current point is updated to the end point of the arc.
centerX | The horizontal coordinate of the center of the arc. |
centerY | The vertical coordinate of the center of the arc. |
radius | The radius of the arc. |
startAngle | The start angle (in radians) of the arc. |
endAngle | The end angle (in radians) of the arc. |
Definition at line 126 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Arc | ( | Point | center, |
double | radius, | ||
double | startAngle, | ||
double | endAngle | ||
) |
Trace an arc segment from a circle with the specified center and radius , starting at startAngle and ending at endAngle . The current point is updated to the end point of the arc.
center | The center of the arc. |
radius | The radius of the arc. |
startAngle | The start angle (in radians) of the arc. |
endAngle | The end angle (in radians) of the arc. |
Definition at line 103 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Close | ( | ) |
Trace a segment from the current point to the start point of the figure and flag the figure as closed.
Definition at line 341 of file GraphicsPath.cs.
Determines whether the specified point falls within the current GraphicsPath.
point | The Point being analysed. |
fillRule | The rule to use to determine whether a point is inside or outside of a the GraphicsPath. |
true
if the point is inside the GraphicsPath, or false
if it is outside. If the point lies exactly on the GraphicsPath (or very close to it), the result may be either true
or false
, depending on numerical approximations.Definition at line 3599 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.CubicBezierTo | ( | double | control1X, |
double | control1Y, | ||
double | control2X, | ||
double | control2Y, | ||
double | endPointX, | ||
double | endPointY | ||
) |
Trace a cubic Bezier curve from the current point to a destination point, with two control points. The current point is updated to the end point of the Bezier curve.
control1X | The horizontal coordinate of the first control point. |
control1Y | The vertical coordinate of the first control point. |
control2X | The horizontal coordinate of the second control point. |
control2Y | The vertical coordinate of the second control point. |
endPointX | The horizontal coordinate of the destination point. |
endPointY | The vertical coordinate of the destination point. |
Definition at line 285 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.CubicBezierTo | ( | Point | control1, |
Point | control2, | ||
Point | endPoint | ||
) |
Trace a cubic Bezier curve from the current point to a destination point, with two control points. The current point is updated to the end point of the Bezier curve.
control1 | The first control point. |
control2 | The second control point. |
endPoint | The destination point. |
Definition at line 261 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Discretise | ( | double | resolution | ) |
Discretises a GraphicsPath, replacing curve segments with series of line segments that approximate them and ensuring that all line segments are shorter than the specified resolution .
resolution | The maximum length (in absolute units) of line segments in the resulting GraphicsPath. |
Definition at line 1966 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.EllipticalArc | ( | double | radiusX, |
double | radiusY, | ||
double | axisAngle, | ||
bool | largeArc, | ||
bool | sweepClockwise, | ||
Point | endPoint | ||
) |
Trace an arc from an ellipse with the specified radii, rotated by axisAngle with respect to the x-axis, starting at the current point and ending at the endPoint .
radiusX | The horizontal radius of the ellipse. |
radiusY | The vertical radius of the ellipse. |
axisAngle | The angle of the horizontal axis of the ellipse with respect to the horizontal axis. |
largeArc | Determines whether the large or the small arc is drawn. |
sweepClockwise | Determines whether the clockwise or anticlockwise arc is drawn. |
endPoint | The end point of the arc. |
Definition at line 142 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Flatten | ( | double | flatness | ) |
Flattens a GraphicsPath, replacing curve segments with series of line segments that approximate them, ensuring the specified maximum deviation from the original path.
flatness | The maximum deviation from the original path. |
Definition at line 1997 of file GraphicsPath.cs.
Rectangle VectSharp.GraphicsPath.GetBounds | ( | ) |
Compute the rectangular bounds of the path.
Definition at line 3037 of file GraphicsPath.cs.
IEnumerable< GraphicsPath > VectSharp.GraphicsPath.GetFigures | ( | ) |
Gets a collection of all the figures in the GraphicsPath, returned as individual GraphicsPaths.
Definition at line 2093 of file GraphicsPath.cs.
IEnumerable< List< Point > > VectSharp.GraphicsPath.GetLinearisationPointsNormals | ( | double | resolution | ) |
Gets a collection of the tangents at the end point of the segments in which the GraphicsPath would be linearised, divided by figure.
resolution | The absolute length between successive samples in curve segments. |
Definition at line 2136 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetNormalAtAbsolute | ( | double | length | ) |
Gets the normal to the point at the absolute position specified on the GraphicsPath.
length | The distance to the point from the start of the GraphicsPath. |
Definition at line 1888 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetNormalAtRelative | ( | double | position | ) |
Gets the normal to the point at the relative position specified on the GraphicsPath.
position | The position on the GraphicsPath (0 is the start of the path, 1 is the end of the path). |
Definition at line 1899 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetPointAtAbsolute | ( | double | length | ) |
Gets the point at the absolute position specified on the GraphicsPath.
length | The distance to the point from the start of the GraphicsPath. |
Definition at line 1304 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetPointAtRelative | ( | double | position | ) |
Gets the point at the relative position specified on the GraphicsPath.
position | The position on the GraphicsPath (0 is the start of the path, 1 is the end of the path). |
Definition at line 1294 of file GraphicsPath.cs.
IEnumerable< List< Point > > VectSharp.GraphicsPath.GetPoints | ( | ) |
Gets a collection of the end points of all the segments in the GraphicsPath, divided by figure.
Definition at line 2050 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.GetStroke | ( | double | lineWidth = 1 , |
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter |
||
) |
Returns a GraphicsPath representing the stroke of the current GraphicsPath.
lineWidth | The thickness of the stroke. |
lineCap | The line cap used in the stroke. |
lineJoin | The line join used in the stroke. |
Definition at line 3445 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetTangentAtAbsolute | ( | double | length | ) |
Gets the tangent to the point at the absolute position specified on the GraphicsPath.
length | The distance to the point from the start of the GraphicsPath. |
Definition at line 1601 of file GraphicsPath.cs.
Point VectSharp.GraphicsPath.GetTangentAtRelative | ( | double | position | ) |
Gets the tangent to the point at the relative position specified on the GraphicsPath.
position | The position on the GraphicsPath (0 is the start of the path, 1 is the end of the path). |
Definition at line 1591 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Linearise | ( | double | resolution | ) |
Linearises a GraphicsPath, replacing curve segments with series of line segments that approximate them.
resolution | The absolute length between successive samples in curve segments. |
Definition at line 1911 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.LineTo | ( | double | x, |
double | y | ||
) |
Move the current point and trace a segment from the previous point.
x | The horizontal coordinate of the new point. |
y | The vertical coordinate of the new point. |
Definition at line 88 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.LineTo | ( | Point | p | ) |
Move the current point and trace a segment from the previous point.
p | The new point. |
Definition at line 66 of file GraphicsPath.cs.
double VectSharp.GraphicsPath.MeasureLength | ( | ) |
Measures the length of the GraphicsPath.
Definition at line 1222 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.MoveTo | ( | double | x, |
double | y | ||
) |
Move the current point without tracing a segment from the previous point.
x | The horizontal coordinate of the new point. |
y | The vertical coordinate of the new point. |
Definition at line 55 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.MoveTo | ( | Point | p | ) |
Move the current point without tracing a segment from the previous point.
p | The new point. |
Definition at line 41 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.QuadraticBezierTo | ( | double | controlX, |
double | controlY, | ||
double | endPointX, | ||
double | endPointY | ||
) |
Trace a quadratic Bezier curve from the current point to a destination point, with a single control point. The current point is updated to the end point of the Bezier curve.
controlX | The horizontal coordinate of the control point. |
controlY | The vertical coordinate of the control point. |
endPointX | The horizontal coordinate of the destination point. |
endPointY | The vertical coordinate of the destination point. |
Definition at line 331 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.QuadraticBezierTo | ( | Point | control, |
Point | endPoint | ||
) |
Trace a quadratic Bezier curve from the current point to a destination point, with a single control point. The current point is updated to the end point of the Bezier curve.
control | The control point. |
endPoint | The destination point. |
Definition at line 298 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Reverse | ( | ) |
Reverses the GraphicsPath.
Definition at line 3335 of file GraphicsPath.cs.
GraphicsPath VectSharp.GraphicsPath.Transform | ( | Func< Point, Point > | transformationFunction | ) |
Transforms all of the Points in the GraphicsPath with an arbitrary transformation function.
transformationFunction | An arbitrary transformation function. |
Definition at line 3018 of file GraphicsPath.cs.
IEnumerable< GraphicsPath > VectSharp.GraphicsPath.Triangulate | ( | double | resolution, |
bool | clockwise | ||
) |
Divides a GraphicsPath into triangles.
resolution | The resolution that will be used to linearise curve segments in the GraphicsPath. |
clockwise | If this is true , the triangles will have their vertices in a clockwise order, otherwise they will be in anticlockwise order. |
Definition at line 2230 of file GraphicsPath.cs.
The segments that make up the path.
Definition at line 33 of file GraphicsPath.cs.