Remarks: A graphics path can contain multiple figures comprised of various components such as line, arc, curve, etc.
Properties
Value: The control object for the widget
CurrentPoint
#Gets the current point
Remarks: If the current figure in the path is not closed, and StartFigure() is not called, the next segment will be connected from this point to its start point.
Value: The current point
IsEmpty
#Gets a value indicating that this graphics path is empty and has no segments
Value:
true if this path is empty; otherwise, false.Methods
AddArc
#Adds an arc into the specified rectangle
Remarks: If the current figure is not closed, it will connect with the start of the arc. The current position will be moved to the ending point of the arc
Parameters:
| x (float) | The x coordinate of the upper left of the arc |
| y (float) | The y coordinate of the upper left of the arc |
| width (float) | Width of the rectangle containing the arc |
| height (float) | Height of the rectangle containing the arc |
| startAngle (float) | Start angle to begin the arc, in degrees |
| sweepAngle (float) | Sweep angle (positive or negative) to specify how long the arc is, in degrees |
AddBezier
#Adds a bezier curve to the path with two control points
Remarks: If the current figure is not closed, it will connect with the
start of the bezier curve. The current position will be moved to the end point.AddCurve
#Adds a curve that intersects with the specified
points to the pathRemarks: Each point in the list will fall on the line based on the
tension parameterParameters:
| points (IEnumerable<PointF>) | Points to calculate the curve |
| tension (float = 0.5) | Tension between points in the curve. Should be between 0 (no curve) and 1 (more curve) |
AddEllipse
#Adds an ellipse to the path
Remarks: Rectangles are separate figures and will not connect to the current or next figure in the path. The starting point of the path will no longer be set after this call.
AddLine
#Adds a line to the path with the specified start and end points
Remarks: If the current figure is not closed, it will connect with the start of this line. The current position will be moved to the specified end location.
AddLines
#Adds lines to each of the specified
points to the pathRemarks: If the current figure is not closed, it will connect with the first point specified. The current position will be moved to the last point specified
Parameters:
| points (IEnumerable<PointF>) | Points for each part of the line |
AddPath
#Adds the specified
path to the current path, optionally connecting the current figure to the start of the pathRemarks: The
connect parameter only specifies that the path should be connected to the current path at the beginning. The end of the specified path will always be connected to the next segment added to this path, unlesss CloseFigure() or StartFigure() are called after this.Parameters:
| path (IGraphicsPath) | Child path to add to this instance |
| connect (bool = false) | True to connect the current figure to the first figure of the specified path, if it is not closed |
AddRectangle
#Adds a rectangle to the path
Remarks: Rectangles are separate figures and will not connect to the current or next figure in the path. The starting point of the path will no longer be set after this call.
CloseFigure
#void CloseFigure()
Closes the current figure by connecting a line to the beginning of the figure
Remarks: This will also make the next segment added to the path start independently from the last figure. To start a new figure without closing the current one, use StartFigure()
FillContains
#Gets a value indicating that the specified
point is contained by the path when filledParameters:
| point (PointF) | Point to test |
Returns:
true if the path contains the point when filled, false otherwiseStartFigure
#void StartFigure()
Starts a new figure without closing the current figure
Remarks: This will make the next segment added to the path independent (unconnected) to the last segment.
StrokeContains
#Gets a value indicating that the spedified
point is on the path when stroked with the specified penReturns:
true if the point is on the path when stroked with the specified pen, false otherwise