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.

 

GdipAddPathArc

 

Description

Adds an elliptical arc to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathArc(

    GpPath *path,

    REAL x,

    REAL y,

    REAL width,

    REAL height,

    REAL startAngle,

    REAL sweepAngle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathArc ( _

    BYVAL path AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYVAL nWidth AS SINGLE, _

    BYVAL nHeight AS SINGLE, _

    BYVAL startAngle AS SINGLE, _

    BYVAL sweepAngle AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x

[in] Simple precision value that specifies the x-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

y

[in] Simple precision value that specifies the y-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

width

[in] Simple precision value that specifies the width of the bounding rectangle for the ellipse that contains the arc.

height

[in] Simple precision value that specifies the height of the bounding rectangle for the ellipse that contains the arc.

startAngle

[in] Simple precision value that specifies the clockwise angle, in degrees, between the horizontal axis of the ellipse and the starting point of the arc.

sweepAngle

[in] Simple precision value that specifies the clockwise angle, in degrees, between the starting point (startAngle) and the ending point of the arc.

 

GdipAddPathArcI

 

Description

Adds an elliptical arc to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathArcI(

    GpPath *path,

    INT x,

    INT y,

    INT width,

    INT height,

    REAL startAngle,

    REAL sweepAngle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathArcI ( _

    BYVAL path AS DWORD, _

    BYVAL x AS LONG, _

    BYVAL y AS LONG, _

    BYVAL nWidth AS LONG, _

    BYVAL nHeight AS LONG, _

    BYVAL startAngle AS SINGLE, _

    BYVAL sweepAngle AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x

[in] Long integer value number that specifies the x-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

y

[in] Long integer value number that specifies the y-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc.

width

[in] Long integer value number that specifies the width of the bounding rectangle for the ellipse that contains the arc.

height

[in] Long integer value number that specifies the height of the bounding rectangle for the ellipse that contains the arc.

startAngle

[in] Simple precision value that specifies the clockwise angle, in degrees, between the horizontal axis of the ellipse and the starting point of the arc.

sweepAngle

[in] Simple precision value that specifies the clockwise angle, in degrees, between the starting point (startAngle) and the ending point of the arc.

 

GdipAddPathBezier

 

Description

Adds a Bézier spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathBezier(

    GpPath *path,

    REAL x1,

    REAL y1,

    REAL x2,

    REAL y2,

    REAL x3,

    REAL y3,

    REAL x4,

    REAL y4

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathBezier ( _

    BYVAL path AS DWORD, _

    BYVAL x1 AS SINGLE, _

    BYVAL y1 AS SINGLE, _

    BYVAL x2 AS SINGLE, _

    BYVAL y2 AS SINGLE, _

    BYVAL x3 AS SINGLE, _

    BYVAL y3 AS SINGLE, _

    BYVAL x4 AS SINGLE, _

    BYVAL y4 AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x1

[in] Simple precision value that specifies the x-coordinate of the starting point of the Bézier spline.

y1

[in] Simple precision value that specifies the y-coordinate of the starting point of the Bézier spline.

x2

[in] Simple precision value that specifies the x-coordinate of the first control point of the Bézier spline.

y2

[in] Simple precision value that specifies the y-coordinate of the first control point of the Bézier spline.

x3

[in] Real number that specifies the x-coordinate of the second control point of the Bézier spline.

y3

[in] Simple precision value that specifies the y-coordinate of the second control point of the Bézier spline.

x4

[in] Simple precision value that specifies the x-coordinate of the ending point of the Bézier spline.

y4

[in] Simple precision value that specifies the y-coordinate of the ending point of the Bézier spline.

 

GdipAddPathBezierI

 

Description

Adds a Bézier spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathBezierI(

    GpPath *path,

    INT x1,

    INT y1,

    INT x2,

    INT y2,

    INT x3,

    INT y3,

    INT x4,

    INT y4

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathBezierI ( _

    BYVAL path AS DWORD, _

    BYVAL x1 AS LONG, _

    BYVAL y1 AS LONG, _

    BYVAL x2 AS LONG, _

    BYVAL y2 AS LONG, _

    BYVAL x3 AS LONG, _

    BYVAL y3 AS LONG, _

    BYVAL x4 AS LONG, _

    BYVAL y4 AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

x1

[in] Long integer value that specifies the x-coordinate of the starting point of the Bézier spline.

y1

[in] Long integer value that specifies the y-coordinate of the starting point of the Bézier spline.

x2

[in] Long integer value that specifies the x-coordinate of the first control point of the Bézier spline.

y2

[in] Integer number that specifies the y-coordinate of the first control point of the Bézier spline.

x3

[in] Long integer value that specifies the x-coordinate of the second control point of the Bézier spline.

y3

[in] Long integer value that specifies the y-coordinate of the second control point of the Bézier spline.

x4

[in] Long integer value that specifies the x-coordinate of the ending point of the Bézier spline.

y4

[in] Long integer value that specifies the y-coordinate of the ending point of the Bézier spline.

 

GdipAddPathBeziers

 

Description

Adds a Bézier spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathBeziers(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathBeziers ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of starting points, ending points, and control points for the connected splines. The first spline is constructed from the first point through the fourth point in the array and uses the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the ending point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third point is the ending point.

count

[in] Long integer value that specifies the number of elements in the points array.

 

GdipAddPathBeziersI

 

Description

Adds a Bézier spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathBeziersI(

    GpPath *path,

    GDIPCONST GpPoint *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathBeziersI ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of starting points, ending points, and control points for the connected splines. The first spline is constructed from the first point through the fourth point in the array and uses the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the ending point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third point is the ending point.

count

[in] Long integer value that specifies the number of elements in the points array.

 

GdipAddPathClosedCurve

 

Description

Adds a closed cardinal spline to this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathClosedCurve(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathClosedCurve ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathClosedCurve function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathClosedCurveI

 

Description

Adds a closed cardinal spline to this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathClosedCurveI(

    GpPath *path,

    GDIPCONST GpPoint *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathClosedCurveI ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathClosedCurveI function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathClosedCurve2

 

Description

Adds a closed cardinal spline to this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathClosedCurve2(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathClosedCurve2 ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Nonnegative simple precision value that controls the length of the curve and how the curve bends. A value of 0 specifies that the spline is a sequence of straight line segments. As the value increases, the curve becomes fuller.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathClosedCurve2 function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddClosedCurve2I

 

Description

Adds a closed cardinal spline to this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathClosedCurve2I(

    GpPath *path,

    GDIPCONST GpPoint *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathClosedCurve2I ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Nonnegative simple precision value that controls the length of the curve and how the curve bends. A value of 0 specifies that the spline is a sequence of straight line segments. As the value increases, the curve becomes fuller.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathClosedCurve2I function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurve

 

Description

Adds a cardinal spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathCurve(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathCurve ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathCurve function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurveI

 

Description

Adds a cardinal spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathCurveI(

    GpPath *path,

    GDIPCONST GpPoint *points,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathCurveI ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathCurve function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurve2

 

Description

Adds a cardinal spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathCurve2(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathCurve2 ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Nonnegative simple precision value that controls the length of the curve and how the curve bends. A value of 0 specifies that the spline is a sequence of straight line segments. As the value increases, the curve becomes fuller.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathCurve2 function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurve2I

 

Description

Adds a cardinal spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathCurve2I(

    GpPath *path,

    GDIPCONST GpPoint *points,

    INT count,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathCurve2I ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through each point in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

tension

[in] Nonnegative simple precision value that controls the length of the curve and how the curve bends. A value of 0 specifies that the spline is a sequence of straight line segments. As the value increases, the curve becomes fuller.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathCurve2 function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurve3

 

Description

Adds a cardinal spline to the current figure of this path.

Syntax

GpStatus WINGDIPAPI GdipAddPathCurve3(

    GpPath *path,

    GDIPCONST GpPointF *points,

    INT count,

    INT offset,

    INT numberOfSegments,

    REAL tension

);

PowerBASIC Syntax

DECLARE FUNCTION GdipAddPathCurve3 ( _

    BYVAL path AS DWORD, _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL offset AS LONG, _

    BYVAL numberOfSegments AS LONG, _

    BYVAL tension AS SINGLE _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object.

points

[in] Pointer to an array of points that define the cardinal spline. The cardinal spline is a curve that passes through a subset (specified by the offset and numberOfSegments parameters) of the points in the array.

count

[in] Long integer value that specifies the number of elements in the points array.

offset

[in] Long integer value that specifies the index of the array element that is used as the first point of the cardinal spline.

numberOfSegments

[in] Long integer value that specifies the number of segments in the cardinal spline. Segments are the curves that connect consecutive points in the array.

tension

[in] Nonnegative simple precision value that controls the length of the curve and how the curve bends. A value of 0 specifies that the spline is a sequence of straight line segments. As the value increases, the curve becomes fuller.

Remarks

You should keep a copy of the points array if those points will be needed later. The GraphicsPath object does not store the points passed to the GdipAddPathCurve3 function; instead, it converts the cardinal spline to a sequence of Bézier splines and stores the points that define those Bézier splines. You cannot retrieve the original array of points from the GraphicsPath object.

 

GdipAddPathCurve3I

 

Description

Adds a cardinal spline to the current figure of this path.