Hi Priya,
Priya Krishnan <Priya.Krishnan Sun.COM> wrote on
04/27/2006 05:20:10 PM:
> I am a newbie SVG/Batik user.
> I have a SVG doc (with just one circle element in it,
onmouseover, the
size changes).
> I use batik-rasterizer to convert the svg to jpg. Now I
have lost the
ability
> to track the mouse events.
> Is there a way to retain the mapping while converting
to jpg.
Is the problem that after you have generated the JPG the
SVG document
is no longer responsive to mouse events (in the Canvas), or
is the
problem that the JPG is not responsive to mouse events when
you view it?
You can fix the first by cloning the document before
giving it to
the Transcoder (see the DOM deepClone method). The second
is impossible
to fix, JPG is a static format - it simply can't do what
SVG can do...
> from the sample---
>
> <circle
onmouseover="circle_mouseover(evt)"
cx="460" cy="400" r="10"
fill="red"/>
>
> <!-- ECMAScript -->
> <script type="text/ecmascript">
> var svgns = "http://www.w3.org/2000/svg
";
>
> function circle_mouseover(evt) {
> if ( window.svgDocument == null )
> svgDocument = evt.target.ownerDocument;
>
> var circle = evt.target;
> var currentRadius =
circle.getAttribute("r");
> text.setAttribute("r",
currentRadius*2);
> }
> }
>
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: batik-users-unsubscribe xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help xmlgraphics.apache.org
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribe xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help xmlgraphics.apache.org
|