You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Maik Schürer proveo GmbH <Ma...@proveo.de> on 2004/10/27 12:23:14 UTC

'apply' a transform ?

Can I "apply" a transform after setAttribute("transform", myTransform) to an
element ?
Should means, the "apply" changes the points of <rect>, <p> etc. and the
"transform" attribute is removed from element.
Thanks in advance
Maik


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: 'apply' a transform ?

Posted by Maik Schürer <Ma...@proveo.de>.
>    Why do you care?
At runtime I build a symbol library from a SVG document.
But in my application library I want have the symbols with a position
"0px/0px" for the center of each symbol.
Of course its also possible to have multiple 'translate' in one transform,
but my (first) idea was to apply the transform to the symbol, so I have not
such a complex transform.or transform attribute is removed completely.
A little help would be to combine multiple 'translate' to one 'translate'
(without parsing the 'translate' strings and add the values) ...
Maik

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 27, 2004 1:43 PM
Subject: Re: 'apply' a transform ?


Hi Maik,

Maik Schürer proveo GmbH wrote:

> Can I "apply" a transform after setAttribute("transform", myTransform) to
an
> element ?
> Should means, the "apply" changes the points of <rect>, <p> etc. and the
> "transform" attribute is removed from element.
> Thanks in advance

    The short answer is 'no'.  Just to take your example of a rect
after a rotation it is no longer a rect (it would have to morph
into a path element).

    The longer answer is that using Java2D and the GVT you could
do this.  You can get the java.awt.Shape objects from
batik.gvt.ShapeNode and use
java.awt.geom.AffineTransform.createTransformedShape(Shape s) to
get the transformed geometry that can then be output as a path
with out a transform.

    Why do you care?



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: 'apply' a transform ?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Maik,

Maik Schürer proveo GmbH wrote:

> Can I "apply" a transform after setAttribute("transform", myTransform) to an
> element ?
> Should means, the "apply" changes the points of <rect>, <p> etc. and the
> "transform" attribute is removed from element.
> Thanks in advance

    The short answer is 'no'.  Just to take your example of a rect
after a rotation it is no longer a rect (it would have to morph
into a path element).

    The longer answer is that using Java2D and the GVT you could
do this.  You can get the java.awt.Shape objects from
batik.gvt.ShapeNode and use
java.awt.geom.AffineTransform.createTransformedShape(Shape s) to
get the transformed geometry that can then be output as a path
with out a transform.

    Why do you care?



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org