zoukankan      html  css  js  c++  java
  • 使用路径arc-奥运五环

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>奥运五环</title>
    </head>
    <body>
      <canvas id="myCanvas"  width="500" height="500" style="border-style:dashed;border-thin"></canvas>

        <script>
            /*arc(x, y, radius, startAngle, endAngle, counterclockwise)
            参数 描述
            x, y 描述弧的圆形的圆心的坐标。
            radius 描述弧的圆形的半径。
            startAngle, endAngle 沿着圆指定弧的开始点和结束点的一个角度。这个角度用弧度来衡量。
            沿着 X 轴正半轴的三点钟方向的角度为 0,角度沿着逆时针方向而增加。
            counterclockwise 弧沿着圆周的逆时针方向(TRUE)还是顺时针方向(FALSE)遍历。*/


            var canvas = document.getElementById("myCanvas");
            //返回绘图对象
            var ctx = canvas.getContext("2d");
            //坐标,圆半径
            ctx.lineWidth = 5;
            ctx.strokeStyle = "#163B62";
            ctx.beginPath();
            ctx.arc(70, 70, 40, 0, Math.PI * 2, false);
            ctx.stroke();

            ctx.strokeStyle = "#000000";
            ctx.beginPath();
            ctx.arc(160, 70, 40, 0, Math.PI * 2, false);
            ctx.stroke();


            ctx.strokeStyle = "#BF0628";
            ctx.beginPath();
            ctx.arc(250, 70, 40, 0, Math.PI * 2, false);
            ctx.stroke();


            ctx.strokeStyle = "#EBC41F";
            ctx.beginPath();
            ctx.arc(110, 110, 40, 0, Math.PI * 2, false);
            ctx.stroke();


            ctx.strokeStyle = "#198E4A";
            ctx.beginPath();
            ctx.arc(200, 110, 40, 0, Math.PI * 2, false);
            ctx.stroke();

           //开始调节
            ctx.strokeStyle = "#163B62";
            ctx.beginPath();
            ctx.arc(70, 70, 40, Math.PI * 1, Math.PI * 2.4, false);
            ctx.stroke();

            ctx.strokeStyle = "#000000";
            ctx.beginPath();
            ctx.arc(160, 70, 40, Math.PI * 1.6, Math.PI * 2.3, false);
            ctx.stroke();

            ctx.strokeStyle = "#BF0628";
            ctx.beginPath();
            ctx.arc(250, 70, 40, Math.PI * 2, Math.PI * 2.9, false);
            ctx.stroke();

            ctx.strokeStyle = "#000000";
            ctx.beginPath();
            ctx.arc(160, 70, 40, Math.PI * 2, Math.PI * 2.8, false);
            ctx.stroke();


          
        </script>
    </body>
    </html>

  • 相关阅读:
    TFS 2010安装指南
    让C#事件也可以异步触发
    Automated BuildDeployTest using TFS 2010
    BLEND + SKETCHFLOW PREVIEW FOR VISUAL STUDIO 2012
    The trust relationship between this workstation and the primary domain failed
    微软发布官方TFS 2010 Scrum 模板
    Visual Studio 2012 New Features: Compatibility (aka Project RoundTripping)
    Hibernate 的<generator class="native"></generator>的不同属性含义
    WDS桥接和WDS中继的区别
    Upgrading TFS 2010 to TFS 2012 RC,tfs2010升级2012
  • 原文地址:https://www.cnblogs.com/xiaoleidiv/p/3171610.html
Copyright © 2011-2022 走看看