xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bishop, Michael W. CONTR J9C880" <Michael.Bis...@je.jfcom.mil>
Subject RE: Conversion for AffineTransform?
Date Tue, 22 Nov 2005 19:15:48 GMT
OK, time to resurrect an old topic.  Right now I'm only using the
translate portion of a transform.  I really don't care how the rest is
handled.  It really depends on the SVG document.  Here's the scenario.

- Load any SVG document.
- Drag an element around the JSVGCanvas by updating its transform
however it's represented.  I guess it doesn't matter really if the
representation of the transform changes as long as it acts the same for
the rest of the attribute.  If I change the "translate" portion, I want
to keep shear, scale, skew, rotate, etc. intact.

Michael Bishop

-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Wednesday, October 26, 2005 9:23 PM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Conversion for AffineTransform?

Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Michael.Bishop@je.jfcom.mil> wrote on

10/26/2005 02:47:33 PM:

> I?m looking for something similar to SVGColor.toSVG() or 
SVGShape.toSVG().  I 
> see there?s an SVGOMMatrix that takes an AffineTransform as a 
constructor 
> argument, but I don?t see a way to create the ?transform=???? from it.

    It's trivial to construct if you are willing to use the 'matrix()'
form.  You can also have a 'translate(tx, ty) matrix(sx, shy, shx, sy,
0, 
0)'
so the transform is pulled out (sx = scaleX, shx = shearX, etc).
If you don't want to use matrix then it depends on you knowing the
form of your affine.
 
> Does one exist?  Similarly, is there one to go from a ?transform=???? 
back to some 
> object?  I?m doing it with string parsing and it?s kinda ugly.

    You can use the parser classes from Batik:
        batik.parser.TransformListParser
      batik.parser.AWTTransformProducer


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

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


Mime
View raw message