开发者

VML alternative to SVG pattern (possibly using Raphael JS)

In SVG it is possible to define a pattern that can be used as the fill for a path. For an example of what I mean you can check this link: SVG pattern example. Unfortunately SVG is not usable in older versions of Internet Explorer, so I'll have to work with VML there.

To make my life a little more easy I use Raphaël JS开发者_JAVA百科 (to be more specific, I use the draw package of ExtJS 4.0, which is based on Raphaël), so I don't have to worry about the differences between SVG and VML.

Raphael JS however, does not provide a way to define patterns and use them, so I'll have to do this by hand. In SVG this is not much of a problem, but in VML I cannot find a way to create a pattern and use it as the (repeating) background of a path.

The closest thing I have found is the ability to use an image as the background of a path, as described here on MSDN. The problem is I want to fill the path with a repeating vector image, so I can scale it and still have it look nice.

Any help in pointing me in the right direction for solving this would be greatly appreciated.

Edit: For people visiting my post: I've come to the conclusion that what I describe above is not possible. The only patterning possible in VML is tiling an image, using a fill element. Patterns made of vector shapes are not possible in VML.


I'm using this method:

1- Create a bounding box with path element (not rect) of the path you want to fill. 2- Append "z" and the path string of the path you want to fill to the bounding box path string. This will create a clipped rect. 3- Use javascript for repeating pattern behind the clipped rect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜