GpPathPointType enumeration

Gives the type of a point of a path, and flags that describe it.

Each point of a GraphicsPath has a type byte. Bits 0 to 2 hold the type: PathPointTypeStart, PathPointTypeLine or PathPointTypeBezier. The higher bits are flags, and a type combines with them using Or. The package wraps the byte in the PathPointType type, whose PointType property returns the three low bits as a member of this enumeration, and whose CloseSubpath, PathMarker and DashMode properties return the flags as Boolean values.

Member Value Description
PathPointTypeStart 0 The point starts a figure.
PathPointTypeLine 1 The point is one of the two ends of a line.
PathPointTypeBezier 3 The point is an end point or a control point of a cubic Bezier spline.
PathPointTypePathTypeMask &H07 A mask for the three low bits that hold the point type.
PathPointTypeDashMode &H10 Not used.
PathPointTypePathMarker &H20 The point is a marker.
PathPointTypeCloseSubpath &H80 The point is the last point of a closed figure.
PathPointTypeBezier3 3 Same as PathPointTypeBezier: a cubic Bezier spline.
PathPointTypeReserved 2 Reserved.
PathPointTypeReservedFlag1 &H08 Reserved.
PathPointTypeReservedFlag2 &H40 Reserved.

Used by

Example

Dim user As GdiPlusUser = GdiPlusUser()
Dim path As GraphicsPath = GraphicsPath()
path.AddRectangle(1, 1, 5, 5)

Dim types() As PathPointType
path.GetTypes types

Dim t As PathPointType
Dim i As Long
For i = LBound(types) To UBound(types)
    t = types(i)
    Debug.Print CLng(t.PointType) & " " & t.CloseSubpath
Next
' Output:
' 0 False
' 1 False
' 1 False
' 1 True

A rectangle has four points. The last one is a line point that also closes the figure.

See Also