Hi Thomas,

Thank you very much for your solution it worked perfectly!!
Another question is if it is possible to truncate a large svg into small
tile svgs? For example, I can define a huge svg, what if I want to convert
the large SVG into small tiles?
If this tiling is possible, a more difficult question is if one large
element can be divided into tiles, is it possible for the tiles to maintain
the embedded hyper link, even the embedded scripting? 
Thank you again for the great help!
Have a great day,

Gang

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 16, 2007 7:49 AM
To: [email protected]
Cc: [email protected]
Subject: Re: Question on Render Portion of a SVG

Hi Gang,

"Gang Su" <[EMAIL PROTECTED]> wrote on 06/13/2007 03:51:36 PM:

> I am new to Batik and found it a great package for SVG.
> I have a question. Is it possible for me to use Batik to render 
> portion of a huge SVG?

   Yes.

> For example, I can define a huge SVG (1,000,000 * 1,000,000), and 
> want to render 100*100 tiles progressively.
> Is it possible?

   Yes, you can do this.  The simplest way would be to use
the SVG Transcoders with an aoi for each 100x100 block.
However, this will rebuild the graphics tree for each 100x100
block, so it may be very slow.

   So a faster way would be to create the Graphics tree once
and repeatedly call 'paint' on the root graphics node.
I would construct a 100x100 BufferedImage, get a Graphics2D
from it and just translate the Graphics2D for each block.

   There is example code for building the Graphics tree on
the Wiki.  You may also find it useful to look at the code
for the Image transcoders (batik.transcoder.image) to understand
how to save the BufferedImage when you are done.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to