Tonny Kohar wrote:

or you can get BufferedImage from JSVGComponent.getOffScreen(), if you
enable offscreen on JSVGComponent, is this correct thomas?
Then draw that bufferedImage to your comp

Hi Tonny, Yes, you could take this approach, although it is quite a bit of overkill (although very simple code wise). I would look at the batik.app.slideshow this directly constructs the GVT tree. The GVT tree (batik.gvt.GraphicsNode) has a paint method that takes a Graphics2D and can be used to render the content.

  The Slideshow app actually uses the GVT tree to render
to an offscreen buffer using the StaticRenderer classes but
you don't need to do this.


Regards Tonny Kohar http://www.kiyut.com

On Sun, 2003-10-12 at 00:00, David Proft wrote:

Hello,

I have seen many examples of how to write swing objects to SVG files and examples of showing SVG files in Swing using the JSVGComponent class. However, I have not been able to find an example that shows how to simply write SVG to a given Graphics object. Let me explain,

My problem is that I am using a graphing package where one can overwrite the node's (which, BTW, is not a Swing component) paint() method. When this node is rendered by the graphing package, I want the SVG image to be drawn.

For example:

private class MyNode extends JGoBasicNode
{
   public void paint(Graphics2D g, JGoView view)
   {
       Rectangle boundingArea = getBoundingRect();   // The area/bounding box to draw 
the SVG into
--->    XXX.drawSVG(<some SVG reference>, g, boundingArea);  // Scale and draw the SVG 
into the bounding area
   }
}

I'm looking for a way to make the above marked line be real code. I have looked at the JSVGComponent source code but am not sure what exactly is needed to do the above.

I know that this is not very efficient and maybe slow. My SVG files are very simple, however. If my performance is still too poor, I will use images (g.grawImage(...)).


Thank you in advance for your help,


David

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






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



Reply via email to