svg矩形参数

Several shapes can be created using SVG drawing. An SVG drawing can use and combine seven shapes: Path, Rectangle, Circle, Ellipse, Line, Polyline, and Polygon.

使用SVG绘图可以创建多个形状。 SVG工程图可以使用和组合七个形状:路径,矩形,圆形,椭圆形,直线,折线和多边形。

路径 (Path)

The path element is the most commonly seen, and is usually generated by programs designed to export SVG code.

path元素是最常见的元素,通常由旨在导出SVG代码的程序生成。

<path d="M2 1 h1 v1 h1 v1 h-1 v1 h-1 v-1 h-1 v-1 h1 z" />

The example path above will generate a “plus” symbole (+) when used inside an SVG drawing. SVG path elements are not built manually, but generated through design programs that can manipulate vector graphics, such as Illustrator or Inkscape.

上面的示例path在SVG工程图中使用时将生成一个“加号”(+)。 SVG path元素不是手动构建的,而是通过可操纵矢量图形的设计程序生成的,例如Illustrator或Inkscape。

长方形 (Rectangle)

The rectangle element rect draws a rectangle on the screen, and it accepts six attributes.

矩形元素rect在屏幕上绘制一个矩形,它接受六个属性。

<rect x="0" y="0" width="100" height="50" rx="10" ry="10" />

x and y assign the position of the top-left corner of the rectangle, and width and height assign the size of the rectangle. rx and ry assign the radius of the rectangle corners, similar to the CSS border-radius property.

xy指定矩形左上角的位置,而widthheight指定矩形的大小。 rxry分配矩形角的半径,类似于CSS border-radius属性。

(Circle)

The circle element circle accepts three attributes.

circle元素circle接受三个属性。

<circle cx="100" cy="100" r="50" />

cx and cy assign the position of the center of the circle, and r assigns the radius (size) of the circle.

cxcy指定圆心的位置,而r指定圆的半径(大小)。

椭圆 (Ellipse)

The ellipse element, ellipse, is similar to the circle element except the radius is split into two attributes.

椭圆元素ellipsecircle元素相似,只不过半径被分为两个属性。

<ellipse cx="100" cy="100" rx="50" ry="20" />

Again, cx and cy assign the position of the center of the ellipse, and now rx and ry assign the horizontal and vertical radius of the ellipse, respectively. A larger rx will give a “fat” ellipse, and a larger ry will give a skinnier ellipse. If rx and ry are equal, it will form a circle.

同样, cxcy指定椭圆中心的位置,现在rxry指定椭圆的水平和垂直半径。 较大的rx将给出“胖”椭圆,而较大的ry将给出更瘦的椭圆。 如果rxry相等,它将形成一个圆圈。

线 (Line)

The line element is simple, and accepts four attributes.

line元素很简单,并且接受四个属性。

<line x1="0" x2="100" y1="50" y2="70" />

The x1 and y1 attributes assign the first point of the line, and the x2 and y2 attributes assign the second point of the line.

x1y1属性指定线的第一点, x2y2属性指定线的第二点。

折线 (Polyline)

A polyline is a series of connected straight lines, assigned in a single attribute.

polyline是在单个属性中分配的一系列连接的直线。

<polyline points="0 100, 50 70, 60 40, 20 0" />

The points attribute assigns a list of points, each point separated by a comma.

points属性会分配一个点列表,每个点之间用逗号分隔。

多边形 (Polygon)

The polygon element is also a series of connected straight lines, but in this case, the last line will automatically reconnect to the initial point.

polygon元素也是一系列连接的直线,但是在这种情况下,最后一条线将自动重新连接到初始点。

<polygon points="0 100, 50 70, 60 40, 20 0" />

This example will draw the same shape as the polyline above, but it will draw an extra line to “close” the series of lines.

本示例将绘制与上面的polyline相同的形状,但是将绘制一条额外的线以“闭合”一系列直线。

更多信息 (More Information)

MDN Documentation: MDN

MDN文档: MDN

翻译自: https://www.freecodecamp.org/news/svg-rectangle-and-other-svg-shapes/

svg矩形参数

svg矩形参数_SVG矩形和其他SVG形状相关推荐

  1. [html] 使用svg画出一个矩形

    [html] 使用svg画出一个矩形 <svg width="400" height="200" viewbox="0 0 2000 1000& ...

  2. svg动画制作_制作第一个SVG动画

    svg动画制作 Story of a designer trying to code animations instead of asking a dev to figure it out. 一位设计 ...

  3. svg text换行_5分钟看懂SVG反爬虫原理与绕过实战 | 知了干货分享

    SVG反爬虫不同于字体反爬虫,它巧妙的利用css 与 svg的关系,将字符映射到网页中,看起来虽然正常,但是却抓取不到有效内容.本文带你深入浅出,破了SVG反爬虫的套路,学会之后,可应用于某点评网. ...

  4. 【opencv】轮廓特征(质心,面积,周长,近似轮廓,凸包,凸度,边界矩形,直角矩形,旋转矩形,最小闭合圈,拟合椭圆、直线)

    4_9_2_轮廓特征 - OpenCV中文官方文档 找到轮廓的不同特征,例如面积,周长,质心,边界框等. 1. 特征矩 特征矩可以帮助您计算一些特征,例如物体的质心,物体的面积等.请查看特征矩上的维基 ...

  5. SVG开发包, 20 个有用的 SVG 工具,提供更好的图像处理

    20 个有用的 SVG 工具,提供更好的图像处理 SVG 现正在 Web 设计领域变得越发流行, 你可以使用 Illustrator 或者 Inkscape 来创建 SVG 图像. 但当进行 Web ...

  6. 基于QGraphicsView、QGraphicsScene、自定义QGraphicsItem的小demo(正矩形、旋转矩形及圆形)

    网上有很多关于这三个的资料,这方面的功能不做过多的描述,仅仅将在做小Demo过程中遇到的问题做下记录,下面是Demo的界面图: Demo的初衷是不想每次使用QGraphicsView和QGraphic ...

  7. 非常方便的将 SVG 图标生成 TTF/EOT/WOFF/WOFF2/SVG 字体

    一般情况我通过 iconfont 或者 icomoon 来实现图标管理生成字体,导入到项目中使用. ┌────────┐ ┌────────────┐ │iconfont │──┐ │ Project ...

  8. 编写矩形类 计算矩形面积

    编写矩形类 计算矩形面积 public class juxing {int a;int b; juxing(int a,int b){System.out.println("矩形面积s=&q ...

  9. svg转css font,css – 如何将.svg文件转换为字体?

    我在Stack Overflow上找到了两个相关的答案: 不幸的是,这两者都不是真正的编码答案,这是我真正希望的(脚本转换的命令行实用程序,或者也许是某人可以编写这样的东西的API). 尽管如此,通过 ...

最新文章

  1. 《算法导论》学习总结 — 13. 第13章 红黑树(2)
  2. 列举在Web前端开发中经常会设置的特殊样式!
  3. Docker教程-深度学习环境配置
  4. 2d的公式_旋转之二 - 三维空间中的旋转:罗德里格旋转公式
  5. 使用JDBCTemplate实现与Spring结合,方法公用 ——共用实现类(BaseImpl)
  6. 御用导航提示页面_UI网站导航设计知识与五个知识案例
  7. python执行adb命令_Python实现对adb命令封装
  8. c++获取sqlite3数据库表中所有字段的方法
  9. java cookie学习
  10. HDU1715 大菲波数【大数】
  11. 计算机主机前耳机没声音,win7系统电脑前面耳机没声音怎么办
  12. 偶尔文艺-关于想要转录MIDI从YAMAHA到MAC
  13. makefile终极目标
  14. codelite解决中文乱码问题
  15. 大型网站系统与Java中间件实践
  16. axure 元件_Axure动态面板(上下左右滑动页面)
  17. 基于select2的二级联动
  18. python 曲线拟合(numpy.polyfit、scipy.optimize.curve_fit)
  19. 仿CNode.js论坛学习
  20. 高伟达业绩暴雷的背后:主业几乎被掏空,利润被并购企业深度捆绑

热门文章

  1. 1024节日快乐~~~~
  2. Collection的使用 字符串保存 java
  3. 字符串拼接与打印相关2
  4. django-自定义错误页面-404
  5. django-带签名的cookie
  6. 一文读懂 IPv4 到 IPv6 的过渡技术
  7. JAVA面试考点解析(12) -- 算法
  8. ProxmoxVE(V5.2) 之 使用外部ceph存储(luminous)
  9. 游戏中的“战争黑雾”和现实中的程序员处境
  10. Java学习笔记1——类和对象