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

Code demonstration to implement canvas Bezier curve effect

高洛峰
Release: 2017-03-15 09:47:12
Original
1860 people have browsed it

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();
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template