Home COM GDI+ WebBrowser Data Access 

GraphicsPath Functions (GDI+)

 

 

A GraphicsPath object stores a sequence of lines, curves, and shapes. You can draw the entire sequence by calling the GdipDrawPath function. You can partition the sequence of lines, curves, and shapes into figures, and with the help of the PathIterator functions, you can draw selected figures. You can also place markers in the sequence, so that you can draw selected portions of the path.

 

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.

 

GdipClearPathMarkers

 

Description

Clears the markers from this path.

Syntax

GpStatus WINGDIPAPI GdipClearPathMarkers(

    GpPath* path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipClearPathMarkers ( _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

 

GdipClonePath

 

Description

Creates a new GraphicsPath object, and initializes it with the contents of this GraphicsPath object.

Syntax

GpStatus WINGDIPAPI GdipClonePath(

    GpPath* path,

    GpPath **clonePath

);

PowerBASIC Syntax

DECLARE FUNCTION GdipClonePath ( _

    BYVAL path AS DWORD, _

    BYREF clonePath AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

clonePath

[out] Pointer to the new GraphicsPath object.

 

GdipClosePathFigure

 

Description

Closes the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipClosePathFigure(

    GpPath *path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipClosePathFigure ( _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

 

GdipClosePathFigures

 

Description

Closes all open figures in this path.

Syntax

GpStatus WINGDIPAPI GdipClosePathFigures(

    GpPath *path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipClosePathFigures ( _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

 

GdipCreatePath

 

Description

Creates a GraphicsPath object and initializes the fill mode.

Syntax

GpStatus WINGDIPAPI GdipCreatePath(

    GpFillMode brushMode,

    GpPath **path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePath ( _

    BYVAL brushMode AS LONG, _

    BYREF path AS DWORD _

) AS LONG

Parameters

 

brushMode

[in] Element of the FillMode enumeration that specifies how areas are filled if the path intersects itself. The default value is FillModeAlternate.

path

[out] Pointer to a variable that receives a pointer to the new GraphicsPath object.

 

GdipCreatePath2

 

Description

Creates a GraphicsPath object and initializes the fill mode.

Syntax

GpStatus WINGDIPAPI GdipCreatePath2(

    GDIPCONST GpPointF* points,

    GDIPCONST BYTE* types,

    INT count,

    GpFillMode fillMode,

    GpPath **path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePath2 ( _

    BYREF pPoints AS PointF, _

    BYREF types AS ANY, _

    BYVAL count AS LONG, _

    BYVAL fillMode AS LONG, _

    BYREF path AS DWORD _

) AS LONG

Parameters

 

points

[in] Pointer to an array of points that specifies the endpoints and control points of the lines and Bezier splines that are used to draw the path.

types

[in] Pointer to an array of bytes that holds the point type and a set of flags for each point in the points array. The point type is stored in the three least significant bits, and the flags are stored in the four most significant bits. Possible point types and flags are listed in the PathPointType enumeration.

count

[in] Long 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.

fillMode

[in] Element of the FillMode enumeration that specifies how areas are filled if the path intersects itself. The default value is FillModeAlternate.

path

[out] Pointer to a variable that receives a pointer  the new GraphicsPath object.

 

GdipCreatePath2I

 

Description

Creates a GraphicsPath object and initializes the fill mode.

Syntax

GpStatus WINGDIPAPI GdipCreatePath2I(

    GDIPCONST GpPoint* points,

    GDIPCONST BYTE* types,

    INT count,

    GpFillMode fillMode,

    GpPath **path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePath2I ( _

    BYREF pPoints AS PointL, _

    BYREF types AS ANY, _

    BYVAL count AS LONG, _

    BYVAL fillMode AS LONG, _

    BYREF path AS DWORD _

) AS LONG

Parameters

 

points

[in] Pointer to an array of points that specifies the endpoints and control points of the lines and Bezier splines that are used to draw the path.

types

[in] Pointer to an array of bytes that holds the point type and a set of flags for each point in the points array. The point type is stored in the three least significant bits, and the flags are stored in the four most significant bits. Possible point types and flags are listed in the PathPointType enumeration.

count

[in] Long 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.

fillMode

[in] Element of the FillMode enumeration that specifies how areas are filled if the path intersects itself. The default value is FillModeAlternate.

path

[out] Pointer to a variable that receives a pointer to the new GraphicsPath object.

 

GdipDeletePath

 

Description

Deletes the specified GraphicsPath object.

Syntax

GpStatus WINGDIPAPI GdipDeletePath(

    GpPath* path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDeletePath ( _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to the GraphicsPath object to delete.

 

GdipFlattenPath

 

Description

Applies a transformation to this path and converts each curve in the path to a sequence of connected lines.

Syntax

GpStatus WINGDIPAPI GdipFlattenPath(

    GpPath *path,

    GpMatrix* matrix,

    REAL flatness

);

PowerBASIC Syntax

DECLARE FUNCTION GdipFlattenPath ( _

    BYVAL path AS DWORD, _

    BYVAL matrix AS DWORD, _

    BYVAL flatness AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

matrix

[in] Pointer to a Matrix object that specifies the transformation to be applied to the path's data points. The default value is NULL, which specifies that no transformation is to be applied.

flatness

[in] Simple precision value that specifies the maximum error between the path and its flattened approximation. Reducing the flatness increases the number of line segments in the approximation. The default value is FlatnessDefault.

 

GdipGetPathData

 

Description

Gets an array of points and an array of point types from this path. Together, these two arrays define the lines, curves, figures, and markers of this path.

Syntax

GpStatus WINGDIPAPI GdipGetPathData(

    GpPath *path,

    GpPathData* pathData

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathData ( _

    BYVAL path AS DWORD, _

    BYREF pData AS PathData _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

pathData

[out] Pointer to a PathData structure that receives the path data. The Points data member of the PathData structure receives a pointer to an array of PointF structures that contains the path points. The Types data member of the PathData structure receives a pointer to an array of bytes that contains the point types. The Count data member of the PathData structure receives an integer that indicates the number of elements in the Points array.

Remarks

A 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.

 

GdipGetPathFillMode

 

Description

Sets the fill mode of this path.

Syntax

GpStatus WINGDIPAPI GdipGetPathFillMode(

    GpPath *path,

    GpFillMode *fillmode

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathFillMode ( _

    BYVAL path AS DWORD, _

    BYREF fillMode AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

fillMode

[out] Pointer to a variable that receives an element of the FillMode enumeration that specifies how to fill areas when the path intersects itself.

 

GdipGetPathLastPoint

 

Description

Gets the ending point of the last figure in this path.

Syntax

GpStatus WINGDIPAPI GdipGetPathLastPoint(

    GpPath* path,

    GpPointF* lastPoint

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathLastPoint ( _

    BYVAL path AS DWORD, _

    BYREF lastPoint AS PointF _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

lastPoint

[out] Pointer to a PointF structure that receives the last point.

 

GdipGetPathPoints

 

Description

Gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

Syntax

GpStatus WINGDIPAPI GdipGetPathPoints(

    GpPath* path,

    GpPointF* points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathPoints ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[out] Pointer to an array of PointF structures that receives the data points. You must allocate memory for this array. You can call the GdipGetPointCount function to determine the required size of the array. The size, in bytes, should be the return value of GdipGetPointCount multiplied by sizeof(PointF).

count

[in] Long integer value that specifies the number of elements in the points array. Set this parameter equal to the return value of the GdipGetPointCount function.

 

GdipGetPathPointsI

 

Description

Gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

Syntax

GpStatus WINGDIPAPI GdipGetPathPointsI(

    GpPath* path,

    GpPoint* points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathPointsI ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[out] Pointer to an array of PointL structures that receives the data points. You must allocate memory for this array. You can call the GdipGetPointCount function to determine the required size of the array. The size, in bytes, should be the return value of GdipGetPointCount multiplied by sizeof(PointF).

count

[in] Long integer value that specifies the number of elements in the points array. Set this parameter equal to the return value of the GdipGetPointCount function.

 

GdipGetPathTypes

 

Description

Gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

Syntax

GpStatus WINGDIPAPI GdipGetPathTypes(

    GpPath* path,

    BYTE* types,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathTypes ( _

    BYVAL path AS DWORD, _

    BYREF types AS ANY, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

types

[out] Pointer to an array that receives the point types. You must allocate memory for this array. You can call the GdipGetPointCount method to determine the required size of the array.

count

[in] Long integer values that specifies the number of elements in the types array. Set this parameter equal to the return value of the GdipGetPointCount function.

 

GdipGetPathWorldBounds

 

Description

Gets a bounding rectangle for this path.

Syntax

GpStatus WINGDIPAPI GdipGetPathWorldBounds(

    GpPath* path,

    GpRectF* bounds,

    GDIPCONST GpMatrix *matrix,

    GDIPCONST GpPen *pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathWorldBounds ( _

    BYVAL path AS DWORD, _

    BYREF bounds AS RectF, _

    BYVAL matrix AS DWORD, _

    BYVAL pen AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

bounds

[out] Pointer to a RectF structure that receives the bounding rectangle.

matrix

[in] Pointer to a Matrix object that specifies a transformation to be applied to this path before the bounding rectangle is calculated. This path is not permanently transformed; the transformation is used only during the process of calculating the bounding rectangle. The default value is NULL.

pen

[in] Pointer to a Pen object that influences the size of the bounding rectangle. The bounding rectangle received in bounds will be large enough to enclose this path when the path is drawn with the pen specified by this parameter. This ensures that the path is enclosed by the bounding rectangle even if the path is drawn with a wide pen. The default value is NULL.

Remarks

The rectangle returned by this method might be larger than necessary to enclose the path as drawn by the specified pen. The rectangle is calculated to allow for the pen's miter limit at sharp corners and to allow for the pen's end caps.

 

GdipGetPathWorldBoundsI

 

Description

Gets a bounding rectangle for this path.

Syntax

GpStatus WINGDIPAPI GdipGetPathWorldBoundsI(

    GpPath* path,

    GpRect* bounds,

    GDIPCONST GpMatrix *matrix,

    GDIPCONST GpPen *pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathWorldBoundsI ( _

    BYVAL path AS DWORD, _

    BYREF bounds AS RectL, _

    BYVAL matrix AS DWORD, _

    BYVAL pen AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

bounds

[out] Pointer to a RectL structure that receives the bounding rectangle.

matrix

[in] Pointer to a Matrix object that specifies a transformation to be applied to this path before the bounding rectangle is calculated. This path is not permanently transformed; the transformation is used only during the process of calculating the bounding rectangle. The default value is NULL.

pen

[in] Pointer to a Pen object that influences the size of the bounding rectangle. The bounding rectangle received in bounds will be large enough to enclose this path when the path is drawn with the pen specified by this parameter. This ensures that the path is enclosed by the bounding rectangle even if the path is drawn with a wide pen. The default value is NULL.

Remarks

The rectangle returned by this method might be larger than necessary to enclose the path as drawn by the specified pen. The rectangle is calculated to allow for the pen's miter limit at sharp corners and to allow for the pen's end caps.

 

GdipGetPointCount

 

Description

Gets the number of points in this path's array of data points. This is the same as the number of types in the path's array of point types.

Syntax

GpStatus WINGDIPAPI GdipGetPointCount(

    GpPath* path,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPointCount ( _

    BYVAL path AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

count

[out] Pointer to a variable thagt receives the number of points in the path's array of data points.

 

GdipIsOutlineVisiblePathPoint

 

Description

Determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

Syntax

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(

    GpPath* path,

    REAL x,

    REAL y,

    GpPen *pen,

    GpGraphics *graphics,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsOutlineVisiblePathPoint ( _

    BYVAL path AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYVAL pen AS DWORD, _

    BYVAL graphics AS DWORD, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x

[in] Simple precision number that specifies the x-coordinate of the point to be tested.

y

[in] Simple precision number that specifies the x-coordinate of the point to be tested.

pen

[in] Pointer to a Pen object. This method determines whether the test point touches the path outline that would be drawn by this pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen.

graphics

[in] Pointer to a Graphics object that specifies a world-to-device transformation. If the value of this parameter is NULL, the test is done in world coordinates; otherwise, the test is done in device coordinates. The default value is NULL.

result

[out] Pointer to a variable that receives a boolean value indicating whether test point touches the outline of this path (TRUE) or not (FALSE).

 

GdipIsOutlineVisiblePathPointI

 

Description

Determines whether a specified point touches the outline of this path when the path is drawn by a specified Graphics object and a specified pen.

Syntax

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI(

    GpPath* path,

    INT x,

    INT y,

    GpPen *pen,

    GpGraphics *graphics,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsOutlineVisiblePathPointI ( _

    BYVAL path AS DWORD, _

    BYVAL x AS LONG, _

    BYVAL y AS LONG, _

    BYVAL pen AS DWORD, _

    BYVAL graphics AS DWORD, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x

[in] Long integer value that specifies the x-coordinate of the point to be tested.

y

[in] Long integer value that specifies the x-coordinate of the point to be tested.

pen

[in] Pointer to a Pen object. This method determines whether the test point touches the path outline that would be drawn by this pen. More points will touch an outline drawn by a wide pen than will touch an outline drawn by a narrow pen.

graphics

[in] Pointer to a Graphics object that specifies a world-to-device transformation. If the value of this parameter is NULL, the test is done in world coordinates; otherwise, the test is done in device coordinates. The default value is NULL.

result

[out] Pointer to a variable that receives a boolean value indicating whether test point touches the outline of this path (TRUE) or not (FALSE).

 

GdipIsVisiblePathPoint

 

Description

Determines whether a specified point lies in the area that is filled when this path is filled by a specified Graphics object.

Syntax

GpStatus WINGDIPAPI GdipIsVisiblePathPoint(

    GpPath* path,

    REAL x,

    REAL y,

    GpGraphics *graphics,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisiblePathPoint ( _

    BYVAL path AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYVAL graphics AS DWORD, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

path