canvas繪製圓形框效果不填充內部
本章節分享一段程式碼例項,它實現了繪製圓形框的效果。
程式碼例項如下:
[HTML] 純文字檢視 複製程式碼執行程式碼<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> </head> <style type="text/css"> canvas{ border:dashed 2px #CCC } </style> <script type="text/javascript"> function $$(id){ return document.getElementById(id); } function pageLoad(){ var can = $$('can'); var cans = can.getContext('2d'); cans.beginPath(); cans.arc(200,150,100,0,Math.PI*2,false); cans.closePath(); cans.lineWidth = 5; cans.strokeStyle = 'red'; cans.stroke(); } window.onload=function(){ pageLoad(); } </script> <body> <canvas id="can" width="400px" height="300px"></canvas> </body> </html>
相關文章
- 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 繪製立體圓環Canvas
- SVG <circle> 繪製圓形SVG
- 使用canvas繪製圓弧動畫Canvas動畫
- canvas繪製網格射線效果Canvas
- canvas繪製卡通人臉形象效果Canvas
- Canvas 繪製 3d 圓柱體Canvas3D
- canvas核心技術-如何繪製圖形Canvas
- canvas繪製經典星空連線效果Canvas
- css繪製圓形程式碼例項CSS
- WPF基礎:在Canvas上繪製圖形Canvas
- canvas繪製箭頭效果程式碼例項Canvas
- 微信小程式 canvas圓角矩形的繪製微信小程式Canvas
- 標準圓形餅圖Python繪製方法Python
- CSS繪製各種幾何圖形形狀效果CSS
- canvas繪製帶有漸變效果的直線Canvas
- 原來 Canvas 也能直接繪製圓角矩形了Canvas
- CSS3繪製圖形圖案效果CSSS3
- canvas 繪製扇形Canvas
- canvas 繪製文字Canvas
- canvas 繪製矩形Canvas
- canvas 奇巧淫技(二)繪製箭頭路徑效果Canvas
- 使用clay.js繪製一棵圓形樹JS
- Python 在PDF中繪製線條、矩形、橢圓形Python
- echarts 繪製圓形進度條帶漸變色Echarts
- canvas立體效果的圓環Canvas