IGraphicsPath

References
Graphics path to be used for drawing or filling using a Graphics object
Remarks: A graphics path can contain multiple figures comprised of various components such as line, arc, curve, etc.

Properties

ControlObject

object ControlObject { get; }
Gets the control object for this widget
inherited fromIControlObjectSource

CurrentPoint

#
PointF CurrentPoint { get; }
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.
The current point

FillMode

#
FillMode FillMode { get; set; }
Gets or sets a value indicating how this graphics path should be filled.

IsEmpty

#
bool IsEmpty { get; }
Gets a value indicating that this graphics path is empty and has no segments

Methods

AddArc

#
void AddArc(float x, float y, float width, float height, float startAngle, float sweepAngle)
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
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

#
void AddBezier(PointF start, PointF control1, PointF control2, PointF end)
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.
start (PointF)Starting point of the bezier curve
control1 (PointF)First control point of the curve
control2 (PointF)Second control point of the curve
end (PointF)Ending point of the bezier curve

AddCurve

#
void AddCurve(IEnumerable<PointF> points, float tension = 0.5)
Adds a curve that intersects with the specified points to the path
Remarks: Each point in the list will fall on the line based on the tension parameter
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

#
void AddEllipse(float x, float y, float width, float height)
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.
x (float)X co-ordinate of the top left of the ellipse
y (float)Y co-ordinate of the top left of the ellipse's bounding rectangle
width (float)Width of the rectangle
height (float)Height of the rectangle

AddLine

#
void AddLine(float startX, float startY, float endX, float endY)
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.
startX (float)X co-ordinate of the starting point
startY (float)Y co-ordinate of the starting point
endX (float)X co-ordinate of the end point
endY (float)Y co-ordinate of the end point

AddLines

#
void AddLines(IEnumerable<PointF> points)
Adds lines to each of the specified points to the path
Remarks: 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
points (IEnumerable<PointF>)Points for each part of the line

AddPath

#
void AddPath(IGraphicsPath path, bool connect = false)
Adds the specified path to the current path, optionally connecting the current figure to the start of the path
Remarks: 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.
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

#
void AddRectangle(float x, float y, float width, float height)
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.
x (float)X co-ordinate of the top left of the rectangle
y (float)Y co-ordinate of the top left of the rectangle
width (float)Width of the rectangle
height (float)Height of the rectangle

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

#
bool FillContains(PointF point)
Gets a value indicating that the specified point is contained by the path when filled
point (PointF)Point to test
true if the path contains the point when filled, false otherwise

LineTo

#
void LineTo(float x, float y)
Adds a line from the current position to the specified location
x (float)X co-ordinate to draw the line to
y (float)Y co-ordinate to draw the line to

MoveTo

#
void MoveTo(float x, float y)
Moves the current position to the specified location without adding anything to the path

StartFigure

#
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

#
bool StrokeContains(Pen pen, PointF point)
Gets a value indicating that the spedified point is on the path when stroked with the specified pen
pen (Pen)Pen to test the stroke with
point (PointF)Point to test
true if the point is on the path when stroked with the specified pen, false otherwise

Transform

#
void Transform(IMatrix matrix)
Transforms the points in the path with the specified matrix