圆角
- var canvas = document.getElementById('canvas'); if (canvas.getContext) {
- context.beginPath(); context.moveTo(20,20);
- context.lineTo(70,20); // 为一条路径画弧度p1.x p1.y p2.x, p2.y 弧半径,
- context.arcTo(120,30,120,70, 50); context.lineTo(120,120);
- context.stroke();
- // 擦除canvas 画板 context.beginPath();
- context.fillRect(10,10,200,100);
- // 擦除区域 context.clearRect(30,30,50,50);
- }
二次贝塞尔曲线
- var canvas = document.getElementById('canvas'); if (canvas.getContext) {
- context.beginPath(); context.moveTo(100,100);
- context.quadraticCurveTo(20,50,200,20); context.stroke();
- }









