1 命令M和L
- 命令
命令 | 名称 | 参数 |
---|---|---|
M | moveto | (x, y) |
L | lineto | (x, y) |
示例
源码
<svg xmlns="http://www.w3.org/2000/svg" width="740" height="100">
<path d="M0,0 L200,100 L400,0 L600,100" fill="transparent" stroke="red"></path>
</svg>
1
2
3
2
3
2 命令Z
- 命令
命令 | 名称 | 参数 |
---|---|---|
Z | close path | none |
示例
源码
<svg xmlns="http://www.w3.org/2000/svg" width="740" height="100">
<path d="M0,0 L200,100 L400,0 L600,100Z" fill="transparent" stroke="red"></path>
</svg>
1
2
3
2
3
3 命令H和V
- 命令
命令 | 名称 | 参数 |
---|---|---|
H | horizontal lineto | x |
V | vertical lineto | y |
示例
源码
<svg xmlns="http://www.w3.org/2000/svg" width="740" height="100">
<path d="M10,90 V10 H120 V90 H220 V10 H320 V90 H420 V10 H520 V90 H620 V10 H720 v90" fill="transparent" stroke="red"></path>
</svg>
1
2
3
2
3
4 命令汇总
命令 | 名称 | 参数 |
---|---|---|
M | moveto | (x, y) |
L | lineto | (x, y) |
Z | close path | none |
H | horizontal lineto | x |
V | vertical lineto | y |