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.strokeStyle = 'red'; cans.strokeRect(30,30,340,240); } 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 lineWidth 繪製原理Canvas
- canvas lineWidth繪製原理Canvas
- canvas 繪製線條Canvas
- canvas 繪製圓角矩形Canvas
- canvas 繪製雙線技巧Canvas
- canvas繪製風車效果Canvas
- canvas 繪製矩形缺角Canvas
- canvas 繪製文字詳解Canvas
- canvas繪製笑臉表情Canvas
- Canvas 繪製雷達圖Canvas
- canvas系列教程之繪製矩形Canvas
- canvas繪製不重合的圓Canvas
- canvas繪製sin正弦曲線Canvas
- Canvas(3)---繪製餅狀圖Canvas
- 用canvas繪製流星夜空Canvas
- canvas 繪製立體圓環Canvas
- canvas繪製動畫的技巧Canvas動畫
- canvas繪製圖案是重疊繪製而不是重置Canvas
- canvas 繪製圖案是重疊繪製而不是重置Canvas
- 使用canvas繪製圓弧動畫Canvas動畫
- canvas繪製網格射線效果Canvas
- canvas繪製卡通人臉形象效果Canvas
- canvas繪製小球漸隱漸現Canvas
- canvas繪製多個圓圈效果Canvas
- canvas繪製扇形程式碼例項Canvas
- canvas繪製圖片drawImage學習Canvas
- 流水賬系列之Canvas繪製-02Canvas
- canvas實現手動繪製矩形Canvas
- 在Canvas中繪製Geojson資料CanvasJSON
- 使用canvas繪製dribble風格水波浪Canvas
- canvas核心技術-如何繪製線段Canvas
- Canvas 繪製 3d 圓柱體Canvas3D