You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Rikard Herlitz <Ri...@excosoft.se> on 2001/10/11 16:10:15 UTC
svg -> java2d
I need to do the opposite of what the svggenerator does.
I need to translate svt into java2d operations and write
them to a file...
It should be quite easy given that the svgviewer does that
already, but I don't know where I can hook in on the java2d
calls to print them out?
Any hints??
/Rikard Herlitz
Re: svg -> java2d
Posted by Vincent Hardy <vi...@sun.com>.
Shazron,
Batik resolves an SVG file into an internal tree called the GVT tree
which can be rendered to a Graphics2D object.
Relevant places to look at:
org.apache.batik.bridge.DocumentLoader
org.apache.batik.swing.svg.GVTTreeBuilder
Vincent.
Shazron Abdullah wrote:
>
> > Write your own subclass of Graphics2D that for each method print's
> >the parameters rather than doing the drawing. But I have no idea what
> >you are going to do with that once you have done it (i.e. you must
> >have some sort of target format or something?). Also it's not clear
> >how you would support everything (like drawImage for example).
> >
> > Good luck...
> >
> >RH> /Rikard Herlitz
>
> Actually I'm wondering the same thing. I think what he is asking is what
> part of Batik generates for example the Graphics.rect(...) calls - since
> at some point Batik parses the SVG and generates the 2D calls to the
> Graphics2D object. What part of Batik does this, does anyone know?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: svg -> java2d
Posted by Shazron Abdullah <sh...@fc.savagesoftware.com>.
> Write your own subclass of Graphics2D that for each method print's
>the parameters rather than doing the drawing. But I have no idea what
>you are going to do with that once you have done it (i.e. you must
>have some sort of target format or something?). Also it's not clear
>how you would support everything (like drawImage for example).
>
> Good luck...
>
>RH> /Rikard Herlitz
Actually I'm wondering the same thing. I think what he is asking is what
part of Batik generates for example the Graphics.rect(...) calls - since
at some point Batik parses the SVG and generates the 2D calls to the
Graphics2D object. What part of Batik does this, does anyone know?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
svg -> java2d
Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "RH" == Rikard Herlitz <Ri...@excosoft.se> writes:
RH> I need to do the opposite of what the svggenerator does. I need
RH> to translate svt into java2d operations and write them to a
RH> file... It should be quite easy given that the svgviewer does
RH> that already, but I don't know where I can hook in on the java2d
RH> calls to print them out?
RH> Any hints??
Write your own subclass of Graphics2D that for each method print's
the parameters rather than doing the drawing. But I have no idea what
you are going to do with that once you have done it (i.e. you must
have some sort of target format or something?). Also it's not clear
how you would support everything (like drawImage for example).
Good luck...
RH> /Rikard Herlitz
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org