quadraticCurveTo - method of the CanvasCtx object

The method adds additional point for the Bézier quadratic curve. A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation. The second point is the ending point of the curve. The base point of the curve is the last point entered. If a point does not exist, then the beginPath() and moveTo() methods are used to define a base point.
Object quadraticCurveTo(Long cpx, Long cpy, Long x, Long y)
cpx(Long) The x-coordinate of the Bézier curve point
cpy(Long) The y-coordinate of the Bézier curve point
x(Long) The x-coordinate of the ending point
y(Long) The y-coordinate of the ending point
The method creates a path. Therefore before calling this method the beginPath method should be called. For the rendering itself the stroke or fill method is used.

This method is also functional in Web panels.
See also:
The ctx variable represents the drawing canvas (CanvasCtx). The setup is done on the "Draw" tab at the beginning of the script of drawing event onDraw as follows:
var ctx = pEvent.GetCtx(1);
JavaScriptSelect and copy to clipboard

ctx.moveTo(20, 20);
ctx.quadraticCurveTo(20, 100, 200, 20);
JavaScriptSelect and copy to clipboard

ctx.moveTo(75, 25);
ctx.quadraticCurveTo(25, 25, 25, 62.5);
ctx.quadraticCurveTo(25, 100, 50, 100);
ctx.quadraticCurveTo(50, 120, 30, 125);
ctx.quadraticCurveTo(60, 120, 65, 100);
ctx.quadraticCurveTo(125, 100, 125, 62.5);
ctx.quadraticCurveTo(125, 25, 75, 25);

Pm8.02.06: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.