canvas繪製多個圓圈效果
分享一段程式碼例項,它實現了利用canvas繪製多個圓圈的效果。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼執行程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <script> window.onload = function () { draw() } function draw() { var canvas = document.getElementById("canvas"); if(canvas == null){ return false; } var context = canvas.getContext('2d'); context.fillStyle = "#eeeeff"; context.fillRect(0,0,400,300); var n = 0; for (var index = 0 ; index < 10; index++) { context.beginPath(); context.arc(index * 25, index * 25, index * 10, 0, Math.PI * 2, true); context.closePath(); context.fillStyle = 'rgba(255,0,0,0.25)'; context.fill(); } } </script> </head> <body> <canvas id="canvas" width="400" height="300"></canvas> </body> </html>
相關文章
- canvas繪製圓盤走動鐘錶效果Canvas
- canvas繪製圓形框效果不填充內部Canvas
- canvas 繪製圓形Canvas
- canvas繪製流星效果Canvas
- canvas 繪製圓角矩形Canvas
- canvas繪製風車效果Canvas
- canvas繪製不重合的圓Canvas
- canvas 繪製立體圓環Canvas
- 使用canvas繪製圓弧動畫Canvas動畫
- canvas繪製網格射線效果Canvas
- canvas繪製卡通人臉形象效果Canvas
- Canvas 繪製 3d 圓柱體Canvas3D
- 使用canvas繪製圓形進度條Canvas
- canvas繪製經典星空連線效果Canvas
- canvas繪製箭頭效果程式碼例項Canvas
- canvas繪製圓形鐘錶程式碼例項Canvas
- 微信小程式 canvas圓角矩形的繪製微信小程式Canvas
- canvas繪製帶有漸變效果的直線Canvas
- 原來 Canvas 也能直接繪製圓角矩形了Canvas
- canvas圓形時鐘效果Canvas
- Canvas繪製一個類似老版支付寶信用分儀表盤效果Canvas
- canvas 繪製扇形Canvas
- canvas 繪製文字Canvas
- canvas 繪製矩形Canvas
- canvas 奇巧淫技(二)繪製箭頭路徑效果Canvas
- 【Web前端基礎知識】如何使用Canvas繪製圓形Web前端Canvas
- Vue canvas繪製圓形進度條動畫載入VueCanvas動畫
- canvas立體效果的圓環Canvas
- canvas繪製直線Canvas
- canvas lineWidth 繪製原理Canvas
- canvas lineWidth繪製原理Canvas
- canvas 繪製線條Canvas
- iOS 繪製圓角iOS
- CSS 繪製半圓CSS
- CSS 繪製圓環CSS
- canvas 繪製雙線技巧Canvas
- canvas繪製矩形框Canvas
- canvas 繪製矩形缺角Canvas