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 Stefan Mueller <sc...@smurn.org> on 2011/04/23 13:14:06 UTC
SVG to Java2D
Hi
Currently I render images using the various drawImage(Image,
AffineTransform,...) method. As expected it produces rather ugly results
since the image pixels do not correspond to screen pixels at all (I'm
heavily using AffineTransformations).
I'd like to replace those images with SVG. How could I do this?
SVG Swing component is not what I need since the area where I need the
graphic is not a component.
Render SVG to an image and then drawImage() it does not work since the
destination area is not pixel aligned.
Any ideas?
cheers
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: SVG to Java2D
Posted by Stefan Mueller <sc...@smurn.org>.
Hi Daniel
Works great!
Thanks
Stefan
Am 23.04.2011 14:19, schrieb Daniel Westheide:
> Hi Stefan,
>
> you need to create a GVT tree from your SVGDocument. You can then call the GVTNode#paint(Graphics2D) method and pass it your Graphics2D instance you want to have your SVG rasterized on.
>
> See http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom on how to create the GVT tree for your SVGDocument.
>
> I think this should work. :)
>
> Best regards
>
> Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: SVG to Java2D
Posted by Daniel Westheide <da...@gmx.de>.
Hi Stefan,
you need to create a GVT tree from your SVGDocument. You can then call the GVTNode#paint(Graphics2D) method and pass it your Graphics2D instance you want to have your SVG rasterized on.
See http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom on how to create the GVT tree for your SVGDocument.
I think this should work. :)
Best regards
Daniel
--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org