老师,看一下

来源:4-5 编程练习

慕函数3468989

2018-11-24 13:06:29

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>canvasL</title>

    <style>

        canvas{background-color:lightblue;}

    </style>

</head>

<body>

    <canvas id="canvas" width="600px" height="600px">您的浏览器不支持</canvas>

    <script>

      // 在此处写出代码

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

      var ctx=canvas.getContext('2d');

      ctx.translate(100,200);

      ctx.rotate(Math.PI/3);

      ctx.scale(.5,.5)

      ctx.strokeRect(100,100,200,300);

    </script>

</body>

</html>

 


写回答

1回答

Miss路

2018-11-25

少了一步,黄色的矩形:

        context.fillStyle="yellow";


如果帮助到了你,欢迎采纳!

祝学习愉快!

0

0 学习 · 4826 问题

查看课程

相似问题