canvas-9NonZeroAroundPrinciples.html
2015-11-23 17:47
513 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>非零环绕原则</title> </head> <body> <canvas id="canvas" style="margin:0 auto;border:1px #ddd solid"> The current browser does not support Canvas, can replace the browser a try! </canvas> <script> window.onload = function(){ var canvas = document.getElementById('canvas'); canvas.width = 1024; canvas.height = 768; if(canvas.getContext('2d')){ var context = canvas.getContext('2d'); context.beginPath(); context.arc(400,400,300,0,Math.PI*2,false); context.arc(400,400,150,0,Math.PI*2,true); context.closePath(); context.fillStyle = "#058"; context.shadowColor = "gray"; context.shadowOffsetX = 10; context.shadowOffsetY = 10; context.shadowBlur = 10; context.fill(); }else{ alert('当前游览器不支持Canvas,请更换游览器后再试!'); } } </script> </body> </html>
相关文章推荐
- Html中背景色之颜色渐变
- 带搜索框的百度地图html
- 提取html中table的正则表达式
- html 页面,兼容1px的问题
- html引用百度地图API
- cordova 如何从手机sdcard上加载html
- C#发送带图片HTML邮件
- canvas-8searchLight4.html
- canvas-8searchLight3.html
- canvas-8searchLight2.html
- canvas-8clip.html
- canvas-7globleCompositeOperation2.html
- canvas-7globleCompositeOperation.html
- canvas-7global.html
- canvas-6shadow.html
- html中offsetTop、clientTop、scrollTop、offsetTop各属性介绍
- html各种数据校验
- html图标插件
- HTML编辑器
- HTML编辑器