vml clipping mask

被刻印的时光 ゝ 提交于 2019-12-06 04:38:11

问题


I am trying to create a clipping mask in VML that would correspond to clip-path in SVG? Is that possible?

Based on numerous, but fairly limited, examples I have tried drawing the shape:

<vml:group style="WIDTH: 1px; HEIGHT: 1px" class=vml-element coordsize = "1,1">
    <vml:shape style="WIDTH: 1px; HEIGHT: 1px" id=vectorObject2 class=vml-element _fill-color="red" _fill-opacity="1" _stroke-color="black" _stroke-opacity="1" _stroke-width="1" coordsize = "1,1" filled = "t" fillcolor = "red" stroked = "t" strokecolor = "black" strokeweight = ".75pt" path = "m0,0 l100,0,0,100 xe">
        <vml:fill class=vml-element opacity = "1"></vml:fill>
        <vml:stroke class=vml-element opacity = "1"></vml:stroke>
    </vml:shape>
</vml:group>

and then masking it using vmlframe:

<vml:vmlframe class=vml-element clip = "t" size = "15pt,37.5pt" src = "#vectorObject2">    </vml:vmlframe>

Drawing of shape (triangle) works as expected but I cannot find I way to mask it using vmlframe. Is that the right way to achieve masking?

Please ignore all bunch of weird custom attributes as majority of VML code was generated via 3rd party library.

Thanks in advance!


回答1:


Use the CSS clip property to emulate clip-path as demonstrated in the Dojo GFX library or something like jsgraphics.



来源:https://stackoverflow.com/questions/11120004/vml-clipping-mask

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!