canvas(HTML)
canvas
Canvas API - Web APIs | MDN
キャンバスでの図形の描画 - Web API | MDN
和
SVG
不同,<canvas>只支援2種基本圖形,正方形和路徑
正方形
fillRect
(x, y, width, height)
實心正方
strokeRect
(x, y, width, height)
空心正方
clearRect
(x, y, width, height)
清除指定領域
x和y為左上角的定錨點
路徑
beginPath
()
closePath
()
stroke
()
fill
()
移動畫筆
moveTo
(x, y)
直線
lineTo
(x, y)
圓
arc
(x, y, radius, startAngle, endAngle, counterclockwise)
arcTo
(x1, y1, x2, y2, radius)
貝茲曲線
quadraticCurveTo
(cp1x, cp1y, x, y)
bezierCurveTo
(cp1x, cp1y, cp2x, cp2y, x, y)
長方形
rect
(x, y, width, height)
Path2D
物件
Canvas 2Dリファレンス - とほほのWWW入門
HTML元素