Drawing Bezier curves

PolyBezierTo()

Draw one or more Bezier curves


SYNTAX

PolyBezierTo(window_id, point_array, count, [start_xpos, start_ypos])

Draw one or more Bezier curves, using the current pen.

The Bezier curve is widely used for computer graphics programming. A single, two-dimensional Bezier curve is defined by four points - two end points and two control points. The ends of the curve are anchored at the two end points; the control points act as “magnets” to pull the curve away from the straight line between the two end points.

window_id

The identifier of the window in which the curve is to be drawn. To print it in the current report, specify NULL instead of a window_id.

point_array

A numeric array containing the co-ordinates of the end points and control points. See Arrays of points. The function draws the first curve from the current position to the third point defined (the end point), using the first two points as control points. Exactly three more points must be defined for each subsequent curve - the two control points, and the end point. The end point of the previous curve is used as the starting point.

count

The number of points in the array. This value should be equal to 3 * the number of curves to be drawn, since each Bezier curve requires two control points and an end point.

[start_xpos, start_ypos]

If these optional parameters are included, the current position is altered to the co-ordinates specified before the curve is drawn.

If start_xpos and start_ypos are not specified, the The PolyBezierTo function starts at the existing current position. It is therefore not always necessary to define a starting point. The end point and the two control points must always be specified.


NOTES

  • The PolyBezierTo function updates the current position to the ending point of the last Bezier curve.

  • No filling is performed on curves drawn with this function.


RELATED TOPICS

Drawing operations

Draw functions