这样对的吗

来源:7-7 编程练习

Ting111

2020-07-06 17:17:08

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8" />

    <title>Document</title>

    <style>

        canvas{background-color:#000;opacity:0.7}

    </style>

</head>

<body>

    <canvas id="canvas" width="1200px" height="1000px">

        您的浏览器不支持canvas

    </canvas>

    <script>

        var canvas=document.getElementById("canvas");

        var cc=canvas.getContext("2d");

        // 在此处补充代码

        cc.save();

        cc.arc(70,60,30,0,Math.PI*2);

        cc.fillStyle='yellow';

        cc.shadowOffsetX=5;

        cc.shadowOffsetY=5;

        cc.shadowColor='rgba(255,255,0,0.7)';

        cc.shadowBlur=10;

        cc.fill();

        cc.restore();

        

        cc.beginPath();

        cc.moveTo(0,1000);

        cc.quadraticCurveTo(100,500,320,1000);

        cc.lineWidth=10;

        cc.strokeStyle='#7A67EE';

        cc.stroke();

        

        cc.beginPath();

        cc.moveTo(280,1000);

        cc.quadraticCurveTo(250,600,600,1000);

        cc.lineWidth=10;

        cc.strokeStyle='#7A67EE';

        cc.stroke();

        

        cc.beginPath();

        cc.moveTo(600,1000);

        cc.quadraticCurveTo(600,400,850,1000);

        cc.lineWidth=10;

        cc.strokeStyle='#7A67EE';

        cc.stroke();

        

        cc.beginPath();

        cc.moveTo(800,1000);

        cc.quadraticCurveTo(900,380,1200,1000)

        cc.strokeStyle='#7A67EE';

        cc.stroke();

        

        var a='山高月小';

        

        cc.fillStyle='white';

        cc.font='60px 宋体';

        cc.shadowOffsetX=10;

        cc.shadowOffsetY=15;

        cc.shadowBlur=7;

        cc.shadowColor='rgba(255,255,255,0.8)'

        cc.fillText(a,800,200);

        

        

        

        

        

        

    </script>

</body>

</html>


写回答

1回答

好帮手慕码

2020-07-06

同学你好,效果正确。继续加油,祝学习愉快~

0

0 学习 · 6815 问题

查看课程