除了使用多边形的'fill'填充方法,还有什么方法可以着色四个点之间的区域吗? 我已经使用四条线条绘制了一个多边形,如下:
<line x1="0" y1="0" x2="300" y2="0" style="stroke:rgb(255,0,0);stroke-width:2"></line>
<line x1="300" y1="0" x2="300" y2="150" style="stroke:rgb(255,0,0);stroke-width:2"></line>
<line x1="300" y1="150" x2="0" y2="150" style="stroke:rgb(255,0,0);stroke-width:2"></line>
<line x1="0" y1="150" x2="0" y2="0" style="stroke:rgb(255,0,0);stroke-width:2"></line>
我想要给这些线之间的区域上色。
rect
、polyline
或甚至是polygon
进行绘制,path
也可以完成工作。有关SVG元素和形状的详细教程,请参见http://tutorials.jenkov.com/svg/index.html,有关更“原始”的文档,请参见https://developer.mozilla.org/en-US/docs/Web/SVG。 - Adriano