Home  >  Article  >  Web Front-end  >  Code demonstration to implement canvas Bezier curve effect

Code demonstration to implement canvas Bezier curve effect

高洛峰
高洛峰Original
2017-03-15 09:47:121784browse

CanvasQuadratic Bezier curve operation example

Switch to cubic Bezier curve generation tool

实现canvas贝塞尔曲线效果代码演示

canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d")
ctx.lineWidth = 6;
ctx.strokeStyle = "#0090D2";
ctx.beginPath();
ctx.moveTo(100, 250);
ctx.quadraticCurveTo(250, 100, 400, 250);
ctx.stroke();

The above is the detailed content of Code demonstration to implement canvas Bezier curve effect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn