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 Chris Smith <ti...@optushome.com.au> on 2001/09/07 09:03:59 UTC
Transforming coordinate system at runtime
Hi,
We're currently having a problem displaying some SVG which we have generated on the fly inside our program, the problem being that we just get an empty window when we try to view the SVG in a JSVGCanvas. I have attached a samle of our SVG. As you can see, the co-ordinates are shifted a long way from the origin. At the moment we are trying to change the rendering transform to shift the graphics back to the origin using:
...
JSVGCanvas canvas = new JSVGCanvas();
...
AffineTransform trans = new AffineTransform();
trans.translate(-315000.0, -812000.0);
canvas.setRenderingTransform(trans);
...
But this does not seem to be working =(
Can anyone help? Unfortunately, due to some design constraints, we can't use the svg <g transform="..."> tags which would seem to be the natural solution.
Thanks,
Chris
Re: Transforming coordinate system at runtime
Posted by Thierry Kormann <tk...@ilog.fr>.
On Friday 07 September 2001 09:03, Chris Smith wrote:
> Hi,
>
> We're currently having a problem displaying some SVG which we have
> generated on the fly inside our program, the problem being that we just get
> an empty window when we try to view the SVG in a JSVGCanvas. I have
> attached a samle of our SVG. As you can see, the co-ordinates are shifted a
> long way from the origin. At the moment we are trying to change the
> rendering transform to shift the graphics back to the origin using:
>
> ...
> JSVGCanvas canvas = new JSVGCanvas();
> ...
What's here ??? If you are specifying a URI or building an SVG DOM tree, and
then use the setURI or setSVGDocument method - you can *not* assume that the
document is not rendered or even built.
For futher details, have a look at the JSVGCanvas tutorial and the section
that describes how to be notified using the different listeners we provide.
Finally, you can do the following in the gvtRenderingCompletedMethod or later
if needed.
see: http://xml.apache.org/batik/svgcanvas.html
> AffineTransform trans = new AffineTransform();
> trans.translate(-315000.0, -812000.0);
> canvas.setRenderingTransform(trans);
> ...
>
> But this does not seem to be working =(
If the previous tips does not solve your problem, sorry about that and could
you send us more details.
Regards,
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org