Name

CRC.bezierCurveTo() — adds a cubic Bézier curve to the current subpath

Synopsis

void bezierCurveTo(float cpX1, float cpY1, 
                   float cpX2, float cpY2, 
                   float x, float y)

Arguments

cpX1, cpY1

The coordinates of the control point associated with the curve’s start point (the current position)

cpX2, cpY2

The coordinates of the control point associated with the curve’s endpoint

x, y

The coordinates of the curve’s endpoint

Description

bezierCurveTo() adds a cubic Bézier curve to the current subpath of a canvas. The start point of the curve is the current point of the canvas, and the endpoint is (x,y). The two Bézier control points (cpX1, cpY1) and (cpX2, cpY2) define the shape of the curve. When this method returns, the current position is (x,y).

Get Canvas Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.