VectSharp
2.2.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 | 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... | |
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... | |
IEnumerable< List< Point > > | GetPoints () |
Gets a collection of the end points of all the segments in the GraphicsPath, divided by figure. 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... | |
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.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 1123 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 312 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 325 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 427 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 572 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 295 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.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.
Rectangle VectSharp.GraphicsPath.GetBounds | ( | ) |
Compute the rectangular bounds of the path.
Definition at line 2929 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 1917 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 1822 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 1833 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 1238 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 1228 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 1872 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 1535 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 1525 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 1844 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 1156 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.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 2910 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 2010 of file GraphicsPath.cs.
The segments that make up the path.
Definition at line 33 of file GraphicsPath.cs.