Slide 13
Slide 13 text
Canvas 2D API
The 2D graphics API works in
element
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.quadraticCurveTo(
x3, y3, x4, y4
);
ctx.stroke();
ctx.fill();
ctx.drawImage(
img,
srcX, srcY,
srcWidth,
srcHeight,
x, y,
width,
height
);
Vector graphics Raster graphics