zoukankan      html  css  js  c++  java
  • 使用路径arc-七彩

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>使用路径</title>
    </head>
    <body>
        <canvas id="ourCanvas" width="450" height="450" style="border:3px dashed #000;" ></canvas>
    <script>
        //arc(float x,float y,float radius,float startAngel,endAngel,booleancounterclockwise)counterclockwise逆时针
        //向Canvas的当前路径添加一段弧。绘制以x、y为圆心的,radius为半径,从startAngel角度开始,到endAngel角度结束的圆弧。startAngel和endAngel以弧度作为单位。
        //true表示逆时针,false表示顺时针
        var canvas = document.getElementById("ourCanvas");
        var ctx = canvas.getContext("2d");

            ctx.beginPath();
            ctx.arc(120, 120,100, 0,120, true);
            ctx.closePath();
            ctx.strokeStyle = "#f00";
            ctx.lineWidth = 20;
            ctx.shadowBlur =15;
            ctx.shadowColor = "#ff0";
            ctx.shadowOffsetX = 7;
            ctx.shadowOffsetY = 7;
            ctx.stroke();

        //for (var i = 0; i < 10; i++) {
        //    ctx.beginPath();
        //    ctx.arc(i * 33, i * 33, (i + 1) * 10, 0, Math.PI * 2, true);
        //    ctx.closePath();
        //    ctx.fillStyle = 'rgba(155,201,93,' + (10 - i) * 0.1 + ')';
        //    ctx.fill();
        //}
    </script>
    </body>
    </html>

  • 相关阅读:
    imagemagick 批量旋转图片 转为横版式
    visual studio 2008 编译 filezilla
    BackgroundWorker 类
    序列化
    打工才是最愚蠢的投资
    常用汇编指令缩写(方便记忆)
    PIC中档单片机汇编指令详解(1)
    Win8之自动登录
    PIC单片机汇编指令
    好文转载—程序员的禅修之路
  • 原文地址:https://www.cnblogs.com/xiaoleidiv/p/3170627.html
Copyright © 2011-2022 走看看