Canvas贝塞尔三级曲线
生活随笔
收集整理的這篇文章主要介紹了
Canvas贝塞尔三级曲线
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
兩個控制點
<!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"><title>bezierCurveTo</title> </head><body><canvas id='myCanvas' width='400' height='200'>your browser does not support canvas</canvas><script type="text/javascript">var c = document.getElementById('myCanvas');var cxt = c.getContext('2d');cxt.beginPath();var sx = 20,sy = 100,cx1 = 45,cy1 = 70,cx2 = 95,cy2 = 130,ex = 120,ey = 100;cxt.moveTo(sx, sy);cxt.bezierCurveTo(cx1,cy1,cx2,cy2,ex,ey);cxt.moveTo(sx, sy);cxt.lineTo(cx1,cy1);cxt.lineTo(cx2,cy2);cxt.lineTo(ex,ey);cxt.moveTo(0, 100);cxt.lineTo(140, 100);cxt.stroke();</script> </body></html>?
轉載于:https://www.cnblogs.com/stono/p/4666952.html
總結
以上是生活随笔為你收集整理的Canvas贝塞尔三级曲线的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【技术分享】CSS 实现渐变色背景
- 下一篇: unix:///tmp/supervis