码迷,mamicode.com
首页 > 其他好文 > 详细

svg

时间:2018-12-29 13:47:47      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:red   svg   width   路径   贝塞尔曲线   relevant   path   二次   line   

<!DOCTYPE html>
<head>
<meta charset="UTF-8">
</head>
<html>
<body>
<div>
<div>M = 移至</div>
<div>L = 画线</div>
<div>H = 竖画线</div>
<div>V = 垂直画线</div>
<div>C = 曲线</div>
<div>S = 光滑的曲线</div>
<div>Q = 二次贝塞尔曲线</div>
<div>T = 光滑二次贝塞尔曲线</div>
<div>A = 椭圆的弧</div>
<div>Z = 关闭路径</div>
<b style="color: red;">注:以上所有命令均允许小写字母。大写表示绝对定位,小写表示相对定位。</b>
</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="600" width="450">
<path id="lineAB" d="M 100 350 l 150 -300" stroke="red" stroke-width="3" fill="none" />
<path id="lineBC" d="M 250 50 l 150 300" stroke="red" stroke-width="3" fill="none" />
<path d="M 175 200 l 150 0" stroke="green" stroke-width="3" fill="none" />
<path d="M 100 350 q 150 -300 300 0" stroke="blue" stroke-width="5" fill="none" />
<path d="M 100 350 q 150 300 300 0" stroke="pink" stroke-width="5" fill="none" />
<!-- Mark relevant points -->
<g stroke="black" stroke-width="3" fill="black">
<circle id="pointA" cx="100" cy="350" r="3" />
<circle id="pointB" cx="250" cy="50" r="3" />
<circle id="pointC" cx="400" cy="350" r="3" />
<circle id="pointD" cx="250" cy="500" r="3" />
</g>
<!-- Label the points -->
<g font-size="30" font="sans-serif" fill="black" stroke="none" text-anchor="middle">
<text x="100" y="350" dx="-30">A</text>
<text x="250" y="50" dy="-10">B</text>
<text x="400" y="350" dx="30">C</text>
<text x="250" y="500" dY="30">D</text>
</g>
</svg>

</body>
</html>

svg

标签:red   svg   width   路径   贝塞尔曲线   relevant   path   二次   line   

原文地址:https://www.cnblogs.com/LindaBlog/p/10195154.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!