Home COM GDI+ WebBrowser Data Access 

PathIterator Functions (GDI+)

 

 

The PathIterator functions allow to isolate selected subsets of the path stored in a GraphicsPath object. A path consists of one or more figures. You can use a GraphicsPathIterator to isolate one or more of those figures. A path can also have markers that divide the path into sections. You can use a GraphicsPathIterator object to isolate one or more of those sections.

 

Return Values

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdipCreatePathIter

 

Description

Creates a new GraphicsPathIterator object and associates it with a GraphicsPath object.

Syntax

GpStatus WINGDIPAPI GdipCreatePathIter(

    GpPathIterator **iterator,

    GpPath* path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePathIter ( _

    BYREF iterator AS DWORD, _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

iterator

[out] Pointer to the new GraphicsPathIterator object.

path

[in] Pointer to a GraphicsPath object that will be associated with this GraphicsPathIterator object.

 

GdipDeletePathIter

 

Description

Deletes the specified GraphicsPathIterator object.

Syntax

GpStatus WINGDIPAPI GdipDeletePathIter(

    GpPathIterator *iterator

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDeletePathIter ( _

    BYVAL iterator AS DWORD _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

 

GdipPathIterCopyData

 

Description

Copies a subset of the path's data points to a PointF array and copies a subset of the path's point types to a BYTE array.

Syntax

GpStatus WINGDIPAPI GdipPathIterCopyData(

    GpPathIterator* iterator,

    INT* resultCount,

    GpPointF* points,

    BYTE* types,

    INT startIndex,

    INT endIndex

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterCopyData ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYREF pPoints AS PointF, _

    BYREF types AS ANY, _

    BYVAL startIndex AS LONG, _

    BYVAL endIndex AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of points copied. This is the same as the number of types copied.

points

[out] Pointer to an array that receives a subset of the path's data points.

types

[out] Pointer to an array that receives a subset of the path's point types.

startIndex

[in] Long integer value that specifies the starting index of the points and types to be copied.

endIndex

[in] Long integer value that specifies the ending index of the points and types to be copied.

 

GdipPathIterEnumerate

 

Description

Copies the path's data points to a PointF array and copies the path's point types to a BYTE array.

Syntax

GpStatus WINGDIPAPI GdipPathIterEnumerate(

    GpPathIterator* iterator,

    INT* resultCount,

    GpPointF *points,

    BYTE *types,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterEnumerate ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYREF pPoints AS PointF, _

    BYREF types AS ANY, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of points copied. This is the same as the number of types copied.

points

[out] Pointer to an array that receives the path's data points.

types

[out] Pointer to an array that receives the path's point types.

count

[in] Lon integer value that specifies the number of elements in the points array. This is the same as the number of elements in the types array.

 

GdipPathIterGetCount

 

Description

Returns the number of data points in the path.

Syntax

GpStatus WINGDIPAPI GdipPathIterGetCount(

    GpPathIterator* iterator,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterGetCount ( _

    BYVAL iterator AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

count

[out] Pointer to a variable that receives the number of data points in the path.

Remarks

This GraphicsPathIterator object is associated with a GraphicsPath object. That GraphicsPath object has an array of points and an array of types. Each element in the array of types is a byte that specifies the point type and a set of flags for the corresponding element in the array of points. Possible point types and flags are listed in the PathPointType enumeration.

 

GdipPathIterGetSubpathCount

 

Description

Returns the number of subpaths (also called figures) in the path.

Syntax

GpStatus WINGDIPAPI GdipPathIterGetSubpathCount(

    GpPathIterator* iterator,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterGetSubpathCount ( _

    BYVAL iterator AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

count

[out] Pointer to a variable that receives the number of data points in the path.

 

GdipPathIterHasCurve

 

Description

Determines whether the path has any curves.

Syntax

GpStatus WINGDIPAPI GdipPathIterHasCurve(

    GpPathIterator* iterator,

    BOOL* hasCurve

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterHasCurve ( _

    BYVAL iterator AS DWORD, _

    BYREF hasCurve AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

hasCurve

[out] Pointer to a variable that receives the number of data points in the path.

Remarks

All curves in a path are stored as sequences of Bézier splines. For example, when you add an ellipse to a path, you specify the upper-left corner, the width, and the height of the ellipse's bounding rectangle. Those numbers (upper-left corner, width, and height) are not stored in the path; instead; the ellipse is converted to a sequence of four Bzier splines. The path stores the endpoints and control points of those Bézier splines.

 

A path stores an array of data points, each of which belongs to a line or a Bzier spline. If some of the points in the array belong to Bzier splines, then GdipPathHasCurve returns TRUE. If all points in the array belong to lines, then  GdipPathHasCurve returns FALSE.

 

Certain methods flatten a path, which means that all the curves in the path are converted to sequences of lines. After a path has been flattened, GdipPathHasCurve will always return FALSE. Flattening happens when you call the GdipFlattenPath, GdipWidenPath, or GdipWarpPath functions.

 

GdipPathIterIsValid

 

Description

Returns the number of subpaths (also called figures) in the path.

Syntax

GpStatus WINGDIPAPI GdipPathIterIsValid(

    GpPathIterator* iterator,

    BOOL* valid

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterIsValid ( _

    BYVAL iterator AS DWORD, _

    BYREF valid AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

valid

[out] Pointer to a variable that receives a boolean value that indicates whether the path iterator specified by the iterator parameter is valid.

 

GdipPathIterNextMarker

 

Description

Gets the starting index and the ending index of the next marker-delimited section in this iterator's associated path.

Syntax

GpStatus WINGDIPAPI GdipPathIterNextMarker(

    GpPathIterator* iterator,

    INT *resultCount,

    INT* startIndex,

    INT* endIndex

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterNextMarker ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYREF startIndex AS LONG, _

    BYREF endIndex AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of data points in the retrieved section. If there are no more marker-delimited sections to retrieve, this method returns 0.

startIndex

[out] Pointer to an LONG that receives the starting index.

endIndex

[out] Pointer to an LONG that receives the ending index.

 

GdipPathIterNextMarkerPath

 

Description

Gets the next marker-delimited section of this iterator's associated path.

Syntax

GpStatus WINGDIPAPI GdipPathIterNextMarkerPath(

    GpPathIterator* iterator,

    INT* resultCount,

    GpPath* path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterNextMarkerPath ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of data points in the retrieved section. If there are no more marker-delimited sections to retrieve, this method returns 0.

path

[out] Pointer to a GraphicsPath object. This method sets the data points of this GraphicsPath object to match the data points of the retrieved section.

 

GdiPathIterNextPathType

 

Description

Gets the starting index and the ending index of the next group of data points that all have the same type.

Syntax

GpStatus WINGDIPAPI GdipPathIterNextPathType(

    GpPathIterator* iterator,

    INT* resultCount,

    BYTE* pathType,

    INT* startIndex,

    INT* endIndex

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterNextPathType ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYREF pathType AS ANY, _

    BYREF startIndex AS LONG, _

    BYREF endIndex AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of data points in the retrieved section. If there are no more marker-delimited sections to retrieve, this method returns 0.

pathType

[out] Pointer to a BYTE that receives the point type shared by all points in the group. Possible values are PathPointTypeLine and PathPointTypeBezier, which are elements of the PathPointType enumeration.

startIndex

[out] Pointer to an LONG that receives the starting index of the group of points.

endIndex

[out] Pointer to an LONG that receives the ending index of the group of points.

 

GdipPathIterNextSubpath

 

Description

Gets the starting index and the ending index of the next subpath (figure) in this iterator's associated path.

Syntax

GpStatus WINGDIPAPI GdipPathIterNextSubpath(

    GpPathIterator* iterator,

    INT *resultCount,

    INT* startIndex,

    INT* endIndex,

    BOOL* isClosed

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterNextSubpath ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYREF startIndex AS LONG, _

    BYREF endIndex AS LONG, _

    BYREF isClosed AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of data points in the next figure. If there are no more figures in the path, this method returns 0.

pathType

[out] Pointer to a BYTE that receives the point type shared by all points in the group. Possible values are PathPointTypeLine and PathPointTypeBezier, which are elements of the PathPointType enumeration.

startIndex

[out] Pointer to an LONG that receives the starting index.

endIndex

[out] Pointer to an LONG that receives the ending index.

isClosed

[out] Pointer to a LONG that receives a boolean value that indicates whether the obtained figure is closed. If the figure is closed, the received value is TRUE; otherwise, the received value is FALSE.

 

GdipPathIterNextSubpathPath

 

Description

Gets the the next figure (subpath) from this iterator's associated path.

Syntax

GpStatus WINGDIPAPI GdipPathIterNextSubpathPath(

    GpPathIterator* iterator,

    INT* resultCount,

    GpPath* path,

    BOOL* isClosed

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterNextSubpathPath ( _

    BYVAL iterator AS DWORD, _

    BYREF resultCount AS LONG, _

    BYVAL path AS DWORD, _

    BYREF IsClosed AS LONG _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

resultCount

[out] Number of data points in the retrieved figure. If there are no more figures to retrieve, this method returns 0.

path

[out] Pointer to a GraphicsPath object. This method sets the data points of this GraphicsPath object to match the data points of the retrieved figure.

isClosed

[out] Pointer to a LONG that receives a boolean value that indicates whether the obtained figure is closed. If the figure is closed, the received value is TRUE; otherwise, the received value is FALSE.

 

GdipPathIterRewind

 

Description

Rewinds this iterator to the beginning of its associated path.

Syntax

GpStatus WINGDIPAPI GdipPathIterRewind(

    GpPathIterator* iterator

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPathIterRewind ( _

    BYVAL iterator AS DWORD _

) AS LONG

Parameters

 

iterator

[in] Pointer to the GraphicsPathIterator object.

 

Page last updated on Monday, 11 December 2006 11:01:49 +0100