Object2D → Object

CurveShape Class

Used for drawing lines and curves in a vector graphics environment.

Properties
ControlX
ControlY
Order
Segments
X2
Y2

# Notes

For CurveShapes, the default value for the Border property is 100 and the default value for Fill is 0.

When you set Order to zero, you get a straight line from x,y to x2, y2. You use control points when you want to 'bend' the line in a particular way. When you set Order to 1, the line bends towards ControlX(0),ControlY(0) on its way from X,Y to X2,Y2. This is what happens in the example. The further away the control point is, the more the line will deviate in that direction.

If Order is set to 2, there are two control points. The line will bend first towards ControlX(0),ControlY(0), and then towards ControlX(1),ControlY(1). At the end points, the curve points directly at the associated control point. The curve is guaranteed to always stay within the polygon formed by the endpoints and the control points (if any).

# Example

The following method, when placed in the MouseDown event of a Window, draws a simple little curve when the user presses the mouse button. The negative value of ControlY(0) places the control point above the imaginary straight line from x,y to x2,y2.

Dim c As New CurveShape
c.controlx(0)=120
c.controly(0)=-40
c.order=1
c.x=10
c.y=10
c.x2=250
c.y2=10
Graphics.DrawObject c,x,y

# See Also

FigureShape, FolderItem, Group2D, Graphics, Object2D, OvalShape, Picture, PixmapShape, RectShape, RoundRectShape, StringShape classes.