Canvas开始

来源:互联网 发布:两个sql查询结果拼接 编辑:程序博客网 时间:2024/05/21 11:21
<!doctype html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport"          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">    <meta http-equiv="X-UA-Compatible" content="ie=edge">    <title>Document</title></head><body>    <canvas id="aa" width="666" height="666"></canvas>    <script>        var canvas = document.getElementById('aa');        var context = canvas.getContext('2d');        context.lineWidth=6;        context.strokeStyle="#7F0";        context.strokeRect(150,250,199,299);        context.fillStyle="#FFB7DD";
//x,y, w,h        context.fillRect(150,250,199,299);        context.beginPath();   //开始绘画            context.arc(500,330,100,0,Math.PI*2,false);            context.closePath();            context.fill();                    context.stroke();    </script></body></html>

原创粉丝点击