You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Web Query <we...@shermantech.com> on 2004/12/09 20:48:56 UTC

Getting visible image displayed on JSVGCanvas

Hi All,

I imagine there is a very simple solution for what I am trying to do 
here.  I would like to get a BufferedImage of what the JSVGCanvas is 
currently displaying.  I have looked into using an ImageTranscoder, but 
I am not clear on exactly how to link the transcoder to the JSVGCanvas 
in order to get a BufferedImage.  Ideally, I am hoping there is some 
function call buried in the JSVGCanvas parent classes that will just 
return the currently displayed BufferedImage.

What is the best way to go about this?

Thanks,
Chris| |||

Re: Getting visible image displayed on JSVGCanvas

Posted by till varoquaux <ti...@laposte.net>.
Web Query wrote:

> Hi All,
>
> I imagine there is a very simple solution for what I am trying to do 
> here.  I would like to get a BufferedImage of what the JSVGCanvas is 
> currently displaying.  I have looked into using an ImageTranscoder, 
> but I am not clear on exactly how to link the transcoder to the 
> JSVGCanvas in order to get a BufferedImage.  Ideally, I am hoping 
> there is some function call buried in the JSVGCanvas parent classes 
> that will just return the currently displayed BufferedImage.
>
> What is the best way to go about this?
>
> Thanks,
> Chris| ||| 

I think getGraphicsNode() (in JGVTComponent) and casting it to a 
Graphics (which can be transformed in an image real easy. Check the 
javadoc) should help you out. Note however that the loading process in 
SVGCanvas is asynchronous. It might not be what you want.
Till

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Getting visible image displayed on JSVGCanvas

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Web,

Web Query wrote:

> I imagine there is a very simple solution for what I am trying to do 
> here.  I would like to get a BufferedImage of what the JSVGCanvas is 
> currently displaying.  I have looked into using an ImageTranscoder, but 
> I am not clear on exactly how to link the transcoder to the JSVGCanvas 
> in order to get a BufferedImage.  Ideally, I am hoping there is some 
> function call buried in the JSVGCanvas parent classes that will just 
> return the currently displayed BufferedImage.

     org.apache.batik.swing.gvt.JGVTComponent.getOffscreen()


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org