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 Priya Krishnan <Pr...@Sun.COM> on 2006/04/27 23:20:10 UTC

preserve mouseEvent while converting svg to jpeg

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-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: preserve mouseEvent while converting svg to jpeg

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Priya Krishnan wrote:
> Hello Andreas,
>
> Yes, I am hoping batik-rasterizer will allow me to specify that I want 
> to preserve the image map, so that I could write event handlers.
>
> Say if I have hrefs in my original SVG, would I lose its hypertext 
> capability once I convert it to a jpg?

yes, I think so. batik-rasterizer creates static images (jpeg, png, pdf, 
etc.). It doesn't create interactive output currently. Someone please 
correct me if I'm wrong.

It might preserve links if you convert it to PDF (but I am not sure 
about that). You'd need to test it.

Andreas




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: preserve mouseEvent while converting svg to jpeg

Posted by Priya Krishnan <Pr...@Sun.COM>.
Hello Andreas,

Yes, I am hoping batik-rasterizer will allow me to specify that I want 
to preserve the image map, so that I could write event handlers.

Say if I have hrefs in my original SVG, would I lose its hypertext 
capability once I convert it to a jpg?

thanking you
Priya


Andreas Neumann wrote:

> Hi Priya,
>
> jpg is a static image format. How can you retain the mouse-events?
>
> Are you expecting batik-rasterizer to create an HTML image map? I 
> don't think it does that.
>
> Andreas
>
> Priya Krishnan wrote:
>
>> 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-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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: preserve mouseEvent while converting svg to jpeg

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Hi Priya,

jpg is a static image format. How can you retain the mouse-events?

Are you expecting batik-rasterizer to create an HTML image map? I don't 
think it does that.

Andreas

Priya Krishnan wrote:
> 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-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


Re: preserve mouseEvent while converting svg to jpeg

Posted by th...@kodak.com.
Hi Priya,

Priya Krishnan <Pr...@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