DrawBezier method

Microsoft Visio Developer Reference

DrawBezier method

       

Creates a new shape whose path is defined by the supplied sequence of Bezier control points.

Version added

4.1

Syntax

objRet = object.DrawBezier(xyArray, degree, flags)

objRet

The new Shape object.

object

Required. The page, master, or group in which to draw the shape.

xyArray

Required Double. An array of alternating x and y values that define the Bezier control points for the new shape.

degree

Required Integer. The degree of the Bezier curve.

flags

Required Integer. Flags that influence how the shape is drawn.

Remarks

The xyArray and degree parameters must meet the following conditions:

1 <= degree <= 9

The number of points must be k * degree + 1, where k is a positive integer. If the first point is called p0, then for any integer m between 1 and k, p(m * degree) is assumed to be the last control point of a Bezier segment, as well as the first control point of the next.

The result is a composite curve that consists of k Bezier segments. The input points from xyArray define the curve's control points. If you want a smooth curve, make sure the points p(n - 1), pn and p(n + 1) are co-linear whenever n = m * degree with an integer m. The composite Bezier curve is represented in the application as a B-spline with integer knots of multiplicity = degree.

The control points should be in internal drawing units (inches) with respect to the coordinate space of the page, master, or group where the shape is being dropped. The passed array should be a type SAFEARRAY of 8-byte floating point values passed by reference (VT_R8|VT_ARRAY|VT_BYREF). This is how Microsoft Visual Basic passes arrays to Automation objects.

The flags argument is a bit mask that specifies options for drawing the new shape. Its value should be zero (0) or visSpline1D (8).

If flags is visSpline1D and the first and last points in xyArray don't coincide, the DrawBezier method produces a shape with one-dimensional (1-D) behavior; otherwise, it produces a shape with two-dimensional (2-D) behavior.

If the first and last points in xyArray do coincide, the DrawBezier method produces a filled shape.