xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres Toussaint <and...@onemileup.com>
Subject Add IMAGE from BufferedImage into a loaded SVG Document
Date Sun, 13 Feb 2005 19:21:31 GMT
I want to add a thumbnail representation of my SVG document in the same 
document when a specific tool is selected, something like this:

1. Change "display" Atribute of TOOL handler layer to "inline" (to 
trigger a updateManager event)

2. Catch updateCompleted 


3. Get the thumbanil image by AffineTransform of the buffered image from 

4. Add the buffered image into my a SVG G Element (recuperated by a 
svgDoc.getElementByID("appendLocation")) in a <IMAGE> element. (This 
will be a added in the UpdateManager thread).

My Main question is: How is the best way to add this image into my document?

Right now the only solution i have is the following, but i think there 
may be a simpler solution:
Create a new Document and a SVGGraphics2D object, and paint into it the 
BufferedImage, and then use the Document.importNode to add the thumbnail 
into the first document.

Also, will doing this approach create a Embedded Image in my SVG? Or how 
is the reference to the Image handled? What format of image will be 
embedded (PNG, JPG,...)?

Any comment will be greatly appreciated.


View raw message