SVG path 标签简介

SVG path 标签用于定义形状的轮廓,可以填充、描边或作为剪切路径。d 属性包含了路径数据,包括 M 移动到、Line 命令、Bezier 曲线和椭圆弧曲线等,提供了丰富的绘图能力。
摘要由CSDN通过智能技术生成

Paths

Paths represent the outline of a shape which can be filled, stroked, used as a clipping path, or any combination of the three[1].

d

d = “path data”. The definition of the outline of a shape.

Pen Command

M(move to)

Command Parameters Repeatable Explanation
M (absolute) x, y Yes 将画笔移动(Move to)到点(x,y)
m (relative) Start a new sub-path at the given (x,y) coordinate.
M (uppercase) indicates that absolute coordinates will follow;
m (lowercase) indicates that relative coordinates will follow.
If a moveto is followed by multiple pairs of coordinates,
the subsequent pairs are treated as implicit lineto commands.
Hence, implicit lineto commands will be relative if the moveto is relative,
and absolute if the moveto is absolute.
If a relative moveto (m) appears as the first element of the path,
then it is treated as a pair of absolute coordinates.
In this case, subsequent pairs of coordinates are treated as relative even though
the initial moveto is interpreted as an absolute moveto.

Line Commands

Command Parameters Repeatable Explanation
L ( l ) x, y Yes 从当前点画直线段到点(x,y) Line to
Draw a line from the current point to the given (x,y) coordinate
which becomes the new current point.
L (uppercase) indicates that absolute coordinates will follow;
l (lowercase) indicates that relative coordinates will follow.
A number of coordinates pairs may be specified to draw a polyline.
A
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值