美文网首页
贝塞尔曲线绘制复选框

贝塞尔曲线绘制复选框

作者: antlove | 来源:发表于2019-04-22 08:59 被阅读0次
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>贝塞尔曲线绘制复选框</title>
    <style>
        body{
            background-color:#eee;
        }
        #canvas{
            background-color:#fff;
            margin-left:10px;
            margin-top:10px;
            box-shadow:4px 4px 8px rgba(0,0,0,0.5);
        }
    </style>
</head>
<body>

    <canvas id="canvas" width="800" height="600"></canvas>

    <script>
        var canvas = document.getElementById("canvas");
        var ctx = canvas.getContext("2d");
        ctx.fillStyle = 'cornflowerblue';
        ctx.fillRect(0, 0, canvas.width, canvas.height);
        ctx.strokeStyle = 'yellow';
        ctx.shadowColor = 'rgba(50,50,50,1)';
        ctx.shadowOffsetX = 2;
        ctx.shadowOffsetY = 2;
        ctx.shadowBlur = 4; 
        ctx.lineWidth = 20;
        ctx.lineCap = 'round';
        ctx.beginPath();
        ctx.moveTo(120.5,130);
        ctx.quadraticCurveTo(150.8, 130, 160.6, 150.5);
        ctx.quadraticCurveTo(190, 250, 210.5, 160.5);
        ctx.quadraticCurveTo(240, 100.5, 290, 70.5);
        ctx.stroke();
    </script>
</body>
</html>
bessel.png

相关文章

网友评论

      本文标题:贝塞尔曲线绘制复选框

      本文链接:https://www.haomeiwen.com/subject/hyyegqtx.html