xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Bunn <...@basen.net>
Subject Re: Is there a light-weight way of rendering multiple SVG -> single Graphics2D?
Date Thu, 21 Sep 2006 07:15:33 GMT

On Sep 17, 2006, at 14:58 , thomas.deweese@kodak.com wrote:

>    I'm not sure why you are bothering with the ImageRenderer.
> I think you could just pass your 'myGraphics2D' into the paint
> method on the gvtRoot element.

Thank you - that simplified it a lot. I'd just managed to miss the  
method while wading through the APIs and code.
For archive purposes, rendering an SVG DOM into a Graphics2D context:

         ...
         public void render( Graphics2D ctx ) {
             UserAgent ua = new UserAgentAdapter();
             BridgeContext bc = new BridgeContext( ua );
             GVTBuilder builder = new GVTBuilder();
             GraphicsNode gvtRoot = builder.build( bc, mySVGDocument );
             gvtRoot.paint( ctx );
         }
         ...

Will look into the dynamic BridgeContext next, it makes a lot of  
sense once I get rid of certain hang-ups in my code.

>    I'm a little curious what your myGraphics2D is.  Is it
> something like a PDFGraphics2D and you are drawing multiple
> pages?

Nothing fancy; just a regular java Graphics2D. It's just that I pick  
several SVG drawings, modify assigned key values (colors,  
transformations) dynamically based on numerical data and scripted  
operations, and produce a collection of data visualization icons in a  
single image. (Yes, eventually I'd just output SVG, but this is not  
an option yet.)


Thanks;
//ebu


---------------------------------------------------------------------
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