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
- 使用java繪圖類Graphics繪製圓圈Java繪圖
- Canvas 繪製 3d 圓柱體Canvas3D
- 使用canvas繪製圓形進度條Canvas
- html5中canvas繪製圓形HTMLCanvas
- canvas繪製卡通人臉形象效果Canvas
- canvas繪製網格射線效果Canvas
- 微信小程式 canvas圓角矩形的繪製微信小程式Canvas
- canvas繪製圓角矩形程式碼例項Canvas
- canvas繪製經典星空連線效果Canvas
- canvas繪製太陽系運動效果Canvas
- canvas繪製北斗七星效果Canvas
- canvas繪製圓環效果程式碼例項Canvas
- canvas繪製圓形鐘錶程式碼例項Canvas
- canvas繪製實心圓形程式碼例項Canvas
- HTML5 Canvas使用路徑——繪製圓形HTMLCanvas
- canvas繪製箭頭效果程式碼例項Canvas
- canvas繪製夜空小屋效果程式碼例項Canvas
- canvas繪製鐘錶效果程式碼例項Canvas
- 使用 HTML5 Canvas 繪製的水滴效果HTMLCanvas
- 原來 Canvas 也能直接繪製圓角矩形了Canvas
- html5中的canvas繪製橢圓的方法HTMLCanvas
- Vue canvas繪製圓形進度條動畫載入VueCanvas動畫
- canvas繪製帶有漸變效果的直線Canvas
- canvas繪製魚吃豆效果程式碼例項Canvas
- canvas繪製雪花飄落效果程式碼例項Canvas
- canvas圓形時鐘效果Canvas
- 【Web前端基礎知識】如何使用Canvas繪製圓形Web前端Canvas
- canvas 繪製矩形Canvas