首页 > 其他 > 详细

Canvas半圆

时间:2014-12-17 10:33:11      阅读:259      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
 <head>
    <meta charset="utf-8">
    <title>Canvas</title>
 </head>
 <style type="text/css">
 </style>
 <script type="text/javascript">
    function $$(id){
        return document.getElementById(id);
    }
    function pageLoad(){
        var can = $$(can);
        var cans = can.getContext(2d);
        var jindu = 2;
        cans.beginPath();
        cans.arc(60,60,50,0,jindu*Math.PI,false);
        cans.strokeStyle = #00aae8;
        cans.lineWidth = 15;
        cans.stroke();
        cans.closePath();
    }
 </script>
<body onload="pageLoad();">
    <div style="position: relative;">
        <canvas id="can" width="120px" height="60px"></canvas>
        <div style="position: absolute;top: 32px;left: 41px;font-size: 21px;font-family: ‘微软雅黑‘;">50%</div>
    </div>
</body>
</html>

 

Canvas半圆

原文:http://www.cnblogs.com/shcolo/p/4168690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!