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繪製直線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繪製圖案是重疊繪製而不是重置Canvas
- Canvas(3)---繪製餅狀圖Canvas
- canvas系列教程之繪製矩形Canvas
- 用canvas繪製流星夜空Canvas
- 使用canvas繪製圓弧動畫Canvas動畫
- canvas繪製不重合的圓Canvas
- canvas繪製sin正弦曲線Canvas
- 流水賬系列之Canvas繪製-02Canvas
- canvas繪製扇形程式碼例項Canvas
- canvas lineWidth繪製原理Canvas
- canvas lineWidth 繪製原理Canvas
- canvas繪製卡通人臉形象效果Canvas
- canvas繪製圖片drawImage學習Canvas
- canvas繪製星星程式碼例項Canvas
- canvas繪製多個圓圈效果Canvas
- canvas繪製網格射線效果Canvas
- canvas繪製小球漸隱漸現Canvas
- canvas 繪製雞蛋程式碼例項Canvas
- canvas 按住滑鼠拖動 繪製文字Canvas