GraphicsPathIterator
System.Drawing.Drawing2D.GraphicsPathIterator
Namespace: System.Drawing.Drawing2D
Assembly: System.Drawing.Managed (4.0.0.0)
Provides the ability to iterate through subpaths in a GraphicsPath and test the types of shapes contained in each subpath. This class cannot be inherited.
public class GraphicsPathIterator : MarshalByRefObject, IDisposablePublic Class GraphicsPathIterator
Inherits MarshalByRefObject
Implements IDisposableConstructors
GraphicsPathIterator(path)
Initializes a new instance of the GraphicsPathIterator class.
Properties
Count
Int32: Gets the number of points in the path.
SubpathCount
Int32: Gets the number of sub paths in the path.
Methods
CopyData(points, types, startIndex, endIndex)
Copies the PathPoints property and PathTypes property arrays of the associated GraphicsPath into the two specified arrays.
points
Upon return, contains an array of PointF structures that represents the points in the path.
types
Upon return, contains an array of bytes that represents the types of points in the path.
Returns: Int32. The number of points copied.
Dispose()
Enumerate(points, types)
Copies the PathPoints property and PathTypes property arrays of the associated GraphicsPath into the two specified arrays.
Returns: Int32. The number of points copied.
Finalize()
Finalizes an instance of the GraphicsPathIterator class.
HasCurve()
Indicates whether the path associated with this GraphicsPathIterator contains a curve.
Returns: Boolean. This method returns true if the current subpath contains a curve; otherwise, false.
NextMarker(path)
Moves the iterator to the next marker in the path.
Returns: Int32. The number of points between this marker and the next.
NextMarker(startIndex, endIndex)
Increments the GraphicsPathIterator to the next marker in the path and returns the start and stop indexes by way of the parameters.
Returns: Int32. The number of points between this marker and the next.
NextPathType(pathType, startIndex, endIndex)
Gets the starting index and the ending index of the next group of data points that all have the same type.
pathType
Receives the point type shared by all points in the group. Possible types can be retrieved from the PathPointType enumeration.
Returns: Int32. This method returns the number of data points in the group. If there are no more groups in the path, this method returns 0.
NextSubpath(path, isClosed)
Gets the next figure (subpath) from the associated path of this GraphicsPathIterator.
path
A GraphicsPath that is to have its data points set to match the data points of the retrieved figure (subpath) for this iterator.
isClosed
Indicates whether the current subpath is closed. It is true if the figure is closed, otherwise it is false.
Returns: Int32. The number of data points in the retrieved figure (subpath). If there are no more figures to retrieve, zero is returned.
NextSubpath(startIndex, endIndex, isClosed)
Moves the GraphicsPathIterator to the next subpath in the path. The start index and end index of the next subpath are contained in the parameters.
Returns: Int32. The number of subpaths in the GraphicsPath object.
Rewind()
Rewinds this GraphicsPathIterator to the beginning of its associated path.
The first time you call the NextSubpath method of an iterator, it gets the first figure (subpath) of that iterator's associated path. The second time, it gets the second figure, and so on. When you call the Rewind method, the sequence starts over; that is, after you call Rewind, the next call to NextSubpath gets the first figure in the path. The NextMarker and NextPathType methods behave similarly.
Last updated
Was this helpful?