Hi Thomas, Thanks, it seems to work fine, except it takes couple of seconds to clone the document and transcode it.
Thanks, Javid On Sat, 6 Aug 2005, Thomas DeWeese wrote: > Hi Javid, > > JAVID M ALIMOHIDEEN MEERASA wrote: > > Thomas, > > I tried subclassing ImageTranscoder and used the SVG document to get the > > bufferedImage but once after transcoding, the document stops responding to > > the canvas, i.e., my java app events are not reflected on the JSVGcanvas > > and also trancoding takes a lot of time for creating an image of size 1280 > > x 1024. > > P.S. My svg document is dynamic. > > Well you can continue in this path by just cloning the document > (batik.dom.util.DomUtilities.deepCloneDocument). > > You could also just use the GVT tree from the canvas with > a Graphics2D associated with your large BufferedImage although > you will have to play with scaling (this is the nice thing about > using the ImageTranscoder - it will handle the fitting for you). > You can get the GVT tree from the Canvas by 'canvas.getGraphicsNode()'. > > > On Fri, 5 Aug 2005, Thomas DeWeese wrote: > > >>JAVID M ALIMOHIDEEN MEERASA wrote: > >> > >> > >>>Thomas, thanks for your suggestion. I got the canvas renderer after the > >>>first rendering and was able to get > >>>the offscreen buffered image. My problem now is, my canvas display size is > >>>600 x 600, so buffered image size is 600 x 600, but i need a buffered > >>>image of size 3000 x 3000, so that i could send the image to a third > >>>party application which can display it on a higher reslution display > >>>system. IS it possible to do this using Batik API? > >> > >> Sure Batik is happy to render to any size canvas. I don't > >>think you want to use the JSVGCanvas to do this however. Probably > >>the simplest thing would be to create a new subclass of the > >>batik.transcoder.image.ImageTranscoder. The baseclass will > >>handle rendering the document to a BufferedImage and you can do > >>what ever you want to with it in the 'writeImage' method. > >> > >> One word of caution is that a 3Kx3K image will take ~36MB > >>so you will probably need to increase the memory partition. > >> > >> > >> > >>>Any suggestion are welcome. > >>> > >>>Thanks, > >>>Javid > >>> > >>>On Tue, 2 Aug 2005, Thomas DeWeese wrote: > >>> > >>> > >>> > >>>>Hi Javid, > >>>> > >>>>Javid Alimohideen wrote: > >>>> > >>>> > >>>> > >>>>>I want to extract the graphics from my JSVGCanvas and send it to another > >>>>>application's image buffer. I tried JSVGComponent.getOffScreen(), but the > >>>>>third party application displays nothing. Can someone tell me how to get > >>>>>the > >>>>>image buffer associated with the JSVGCanvas or JSVGComponent? > >>>> > >>>> This is the buffer the JSVGComponent is using for display, > >>>>but you may be grabbing it too soon. It only has 'good data' in > >>>>it after the first GVT rendering completes. > >>>> > >>>> > >>>> > >>>>>IS the following possible? > >>>>>JSVGCanvas canvas; > >>>>>canvas.renderer.getOffScreen(). > >>>> > >>>> This is actually less reliable as the renderer may be in the > >>>>middle of rendering the image. > >>>> > >>>> > >>>> > >>>>>P.S. I need the data buffer to be displayed by a third party C++ > >>>>>application. > > > --------------------------------------------------------------------- > 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]
