首页 > 代码库 > 圆角锯齿
圆角锯齿
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>锯齿</title> <script type="text/javascript"> window.addEventListener("load", eventWindowLoaded, false); function eventWindowLoaded(){ var x,y; var theCanvas = document.getElementById("canvas"); var context = theCanvas.getContext("2d"); context.strokeStyle = ‘#CB9A61‘; context.lineWidth=10; context.strokeRect(10, 10, theCanvas.width-20, theCanvas.height-20); context.fillStyle = "#FFFFFF"; for(x=5;x<=canvas.width;x=x+10){ context.beginPath(); context.arc(x,5,5,0,Math.PI*2,true); context.arc(x,canvas.height-5,5,0,Math.PI*2,true); context.closePath(); context.fill(); } for(y=5;y<=canvas.height;y=y+10){ context.beginPath(); context.arc(5,y,5,0,Math.PI*2,true); context.arc(canvas.width-5,y,5,0,Math.PI*2,true); context.closePath(); context.fill(); } } </script> </head> <body> <div style="position: absolute; top: 100px; left: 100px;"> <canvas id="canvas" width="400" height="170" top=50px; left=50px;> </div> </body> </html>
圆角锯齿
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。