List Info

Thread: preserve mouseEvent while converting svg to jpeg




preserve mouseEvent while converting svg to jpeg
user name
2006-04-27 21:20:10
hi!

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. 

your help is greatly appreciated.
thanks
Priya

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-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org

preserve mouseEvent while converting svg to jpeg
user name
2006-04-28 01:03:40
Hi Priya,

Priya Krishnan <Priya.KrishnanSun.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-unsubscribexmlgraphics.apache.org
> For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )