<v:group id="group1" style="position:relative;width:200px;height:200px;" coordsize = "2000,2000">
<v:rect style="width:2000px;height:2000px" fillcolor="#99cccc">
<v:shadow on="t" type="single" color="silver" offset="5pt,5pt">
</v:rect>
<v:oval style="position:relative;top:100;left:100;width:1000;height:1000;z-index:7;" fillcolor="red" strokecolor="red"/>
<v:rect style="position:relative;top:500;left:300;width:1000;height:1000;z-index:8;" fillcolor="blue" strokecolor="blue"/>
<v:line from="200,200" to="1000,1700" style="z-index:9" fillcolor="yellow" strokecolor="yellow" strokeweight=2pt/>
</v:group>
相信如果你看懂了上面的代码,对 group 一定理解了。上面使用了一个和group一样大小的 rect 作为 group的边框,然后加上阴影渲染。用msdn的一个很有意思的例子再看看 group 的重要用法:(改变滚动条的值,右边的图片会相应的旋转)
该例子中,那张图片完全是用vml画出来的,动态改变 group 的 rotation 属性就可以实现整个 group 里面的对象旋转。
发表评论