ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 用quadraticCurveTo 绘制 canvas 贝塞尔曲线 ![](https://img.kancloud.cn/ea/27/ea27ac6cb720823e56bea4d96f215c37_311x98.png) 相关代码: ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>canvas</title> </head> <body> <canvas id="canvas" width="300" height="400"> 您的浏览器不支持 HTML5 canvas 标签。 </canvas> <script> var c = document.getElementById('canvas'); var ctx = c.getContext('2d'); ctx.beginPath(); ctx.moveTo(20, 20); ctx.quadraticCurveTo(20, 100, 200, 20); ctx.stroke(); ctx.closePath(); </script> </body> </html> ~~~