以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  请问在svg里面怎么画虚线阿  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=52898)


--  作者:zq200487731
--  发布时间:9/20/2007 4:13:00 PM

--  请问在svg里面怎么画虚线阿
rt期望高手回答
--  作者:我的牛会唱歌
--  发布时间:9/27/2007 8:11:00 AM

--  
3.2.4 stroke-dasharray attribute
If you need dotted or dashed lines, use the stroke-dasharray attribute, whose value
consists of a list of numbers, separated by commas or white- space, specifying dash
length and gaps. The list should have an even number of entries, but if you give an odd
number of entries, SVG will repeat the list so the total number of entries is even. (See the last instance in Example 3-5.)
Example 3-5. Demonstration of stroke-dasharray
<svg width="200px" height="200px" viewBox="0 0 200 200">
<!-- nine-pixel dash, five-pixel gap -->
<line x1="10" y1="10" x2="100" y2="10"
style="stroke-dasharray: 9, 5;
stroke: black; stroke-width: 2;" />
<!-- five-pixel dash, three-pixel gap, nine-pixel dash,
two-pixel gap -->
<line x1="10" y1="20" x2="100" y2="20"
style="stroke-dasharray: 5, 3, 9, 2;
stroke: black; stroke-width: 2;" />
<!-- Odd number of entries is duplicated; this is equivalent
to:
nine-pixel dash, three-pixel gap, five-pixel dash,
nine-pixel gap, three-pixel dash, five-pixel gap -->
<line x1="10" y1="30" x2="100" y2="30"
style="stroke-dasharray: 9, 3, 5;
stroke: black; stroke-width: 2;" />
</svg>
以上内容摘自《SVG essentials》
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
2,902.344ms