WinXDrawBezier


hElement = WinXDrawBezier (hWnd, hPen, x1, y1, x2, y2, xC1, yC1, xC2, yC2)

Draws a bezier spline

Parameter Description
hWnd The handle to the window to draw the spline on
hPen The handle to the pen to draw the spline with
x1, y1 The starting point of the spline
x2, y2 The ending point of the spline
xC1, yC1 The first control point of the spline
xC2, yC2 The second control point of the spline

Returns

The id of the spline or -1 on fail

Remarks

If you register the onPaint callback, this function has no effect. This line will not be visible untill you call the WinXUpdate function. You can use the id returned by this function to undo the ellipse with the WinXUndo function.

Bezier splines have two control points which define how curved the spline is. Wikipedia has a good animation showing how Bezier splines work.

Examples

'create a pen
hPen = CreatePen ($$PS_SOLID, 3, 0x00FF0000)

'Draw the spline
WinXDrawBezier (#hMain, hPen, 100, 0, 200, 100, 200, 0, 100, 100)

Related Links

WinXDrawLine
WinXDrawArc
onPaint (Callback)
WinXUpdate
WinXUndo