An example of the HTML5 canvas path functions: bezierCurveTo() example

This draws a bezier curve. The pen is first positioned at the left hand side of the curve and then the bezierCurveTo() function supplies the other points.

[No canvas support]
<script>
    context = document.getElementById('cvs').getContext('2d');
    
    context.beginPath();
        context.moveTo(50,200);
        context.bezierCurveTo(100,0,500,0,550,200);
    context.stroke();
</script>

« Back to article