TOC : Script API > JavaScript > JavaScript API > GeneralScript > DrawingContext > Method >

 

quadraticCurveTo

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

TOC : Script API > JavaScript > JavaScript API > GeneralScript > DrawingContext > Method >

 

quadraticCurveTo

 

 

Draw a two-dimensional curve using the start, end and control points.

 

 

 

Prototype :

 

void quadraticCurveTo

(

        float ControlPointX,

        float ControlPointY,

        float EndPointX,

        float EndPointY

)

 

 

 

Arguments :

 

ControlPointX

The X-coordinate for control point

ControlPointY

The Y-coordinate for control point

EndPointX

The X-coordinate for end point

EndPointY

The Y-coordinate for end point

 

 

 

Reference :

 

The X and Y coordinates are for the center point of the quadraticCurveTo in relation to the upper-left corner of the component.

 

The starting point of the two-dimensional curve sets using the moveTo function.

 

The function draws the shape on the screen regardless of transparency or clipping of the component and it can draw the arc even in areas outside of the component. However, the shape drawn outside the input component area is clipped.

 

The shape drawn by the function can be exported only in pdf, jpg, png, gif, tif, svg format.

 

 

 

Example :

 

ctx.beginPath();

ctx.strokeStyle = "#FF0000";

ctx.lineWidth = 2;

ctx.moveTo(10, 25);

ctx.quadraticCurveTo(30, 5, 50, 25);

ctx.stroke();

ctx.moveTo(60, 25);

ctx.quadraticCurveTo(80, 5, 100, 25);

ctx.stroke();

ctx.moveTo(30, 40);

ctx.quadraticCurveTo(50, 65, 80, 40);

ctx.stroke();

 

 

 

Available Events :

 

OnPostDraw,  OnPreDraw

 

 

 

See also :

 

moveTo