zoukankan      html  css  js  c++  java
  • 绘制圆弧的几种简单方法

    展示图:

    //绘制圆弧  true:逆时针  false:顺时针
    context.lineWidth=5;
    context.strokeStyle="pink";                                                      
    context.arc(40,40,30,0,Math.PI*2);
    context.stroke();//外环是粉色的圆,无填充色


    context.beginPath();
    context.strokeStyle="yellow";
    context.fillStyle="red";
    context.arc(100,40,30,0,Math.PI*2);
    context.fill();
    context.stroke();//外环是黄色,内填充是red

    context.beginPath();
    context.strokeStyle="yellow";
    context.fillStyle="red";
    context.arc(180,40,30,0,Math.PI/3,true);
    context.stroke(); //外环是黄色

    context.beginPath();
    context.strokeStyle="yellow";
    context.fillStyle="red";
    context.arc(260,40,30,0,Math.PI/3,true);
    context.fill();//内填充是red的60度的弧

    context.beginPath();
    context.strokeStyle="yellow";
    context.fillStyle="red";
    context.arc(260,100,30,0,Math.PI/3,true);
    context.fill();
    context.stroke();//外环是黄色,内填充是red的60度的弧

  • 相关阅读:
    Largest Submatrix of All 1’s
    Max Sum of Max-K-sub-sequence
    Sticks Problem
    Splay模版
    B. Different Rules
    链表合并 leetcode
    K个一组翻转链表
    反转链表2 leetcode
    nodejs简单仿apache页面
    HTML 5 Web Workers
  • 原文地址:https://www.cnblogs.com/Litter-Tulip/p/5264880.html
Copyright © 2011-2022 走看看