zoukankan      html  css  js  c++  java
  • canvas

    <script>
    var canvas = document.getElementById('canvas');
    var ctxt = canvas.getContext('2d');
    var w = canvas.width;
    var h = canvas.height;
    //外圆
    ctxt.beginPath();
    ctxt.moveTo(w * 0.5 ,h * 0.5);
    ctxt.arc(w * 0.5 ,h * 0.5 , 100 , 0 ,Math.PI *2);
    ctxt.closePath();
    ctxt.fillStyle = "#f96032";
    ctxt.fill();

    //内圆
    ctxt.beginPath();
    ctxt.moveTo(w * 0.5 ,h * 0.5);
    ctxt.arc(w * 0.5 ,h * 0.5 , 93 , 0 ,Math.PI *2);
    ctxt.closePath();
    ctxt.fillStyle = "#fff";
    ctxt.fill();

    //圆环内文字
    var barW = $('.tin-piebar').width();
    var barH = $('.tin-piebar').height();
    var barInfoW = $('.tip-piebar').width();
    var barInfoH = $('.tip-piebar').height();
    console.log(barW)
    $('.tip-piebar').css({
    'top' : (barH - barInfoH) /2,
    'left': (barW - barInfoW) /2
    })
    $(window).resize(resizeCanvas);
    function resizeCanvas() {
    canvas.attr("width", $(window).get(0).innerWidth);
    // canvas.attr("height", $(window).get(0).innerHeight);
    // context.fillRect(0, 0, canvas.width(), canvas.height());
    };
    resizeCanvas();

    </script>

  • 相关阅读:
    windows cmd 编码
    ARM伪指令
    System.load 和 System.loadLibrary
    用GDB调试程序
    ARM指令集
    ARM寻址方式
    abortion
    Oxford City Jealous Lover
    everyday words
    【转】高效率的C++函数返回值
  • 原文地址:https://www.cnblogs.com/mmzuo-798/p/5581715.html
Copyright © 2011-2022 走看看