George Armhold wrote:
Thomas DeWeese wrote:
Fortunately this example can be done about as simply by
defining a pattern that uses the background content and setting
the pattern as the fill for the lines. You need to setup the
patternUnits and patternContent units properly but this should
not be significantly more difficult than setting up feImage
and the filter properly.
Your suggestion of using a pattern turned out to actually be easier to
implement than the equivalent code using a filter. However I very
quickly run out of memory (even on simple docs) using this technique. I
now have a document that looks like this:
Ahh, yah, for complex SVG it will copy the SVG content for each
instance of the pattern (i.e. each line). Ideally it would detect
when the pattern instances match and reuse the graphics tree (in
thinking about this I think the pattern's associated graphics tree can
always be reused across uses each may have a different associated
pattern transform).
one other approach would be clip, but this will be problematic
as clip doesn't apply stroke. so you would have to 'draw' the
wide lines yourself (although for single lines it's pretty easy
- circle/elliptical arc, rect/line to, circle/elliptical arc).
<svg>
<defs>
<pattern id="bgPattern"
patternUnits="userSpaceOnUse"
width="100%" height="100%">
<g>
<!-- insert background image code here -->
</g>
</pattern>
</defs>
</svg>
Now whenever the user draws with the mouse I add <line> elements that
specify bgPattern as the stroke pattern. This works, but extremely
slowly. It also very quickly uses up about 280MB of RAM before
getting an OutOfMemoryErrorException.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]