xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Re: Re: 1.5 beta5: How to get viewbox coordinates from pixel coor dinates
Date Tue, 08 Apr 2003 14:55:42 GMT

Hi Gold,

>>>>> "GM" == Gold Martin <Martin.Gold@blva.bayern.de> writes:

GM> thank you Vincent for the prompt answer, Can I get the viewbox
GM> coordinates directly from/with Batik, too - without using
GM> Javascript ?  How to do this ?

    'get the viewbox coords directly' - 'directly' where? In Java?
What part of Java?  MouseEvents? GraphicsNodeMouseEvents? DOM
MouseEvents?...
    
    Current CVS Batik JSVGComponent (base class of JSVGCanvas) has an
additional method getViewBoxTransform() that returns the transform
from viewbox to screen.  Also all the methods in javaScript are also
available in Java (and using getScreenCTM is probably better than
assuming your elements are in the viewBox coordinate system).

GM> best regards, Martin

    I hope this helps.

GM> Hi Martin,

GM> If you look at the
GM> samples/tests/spec/scripting/currentScaleTranslate.svg example
GM> that Thomas put together, you'll find a mouseOver(evt) function
GM> that shows how to convert from the evt's clientX/clientY to user
GM> space coordinates.

GM> Vincent.

GM> Gold Martin wrote:
>> hello,
>> 
>> I'm new to Batik. So my understanding of Batik is still very low.
>> 
>> In 1.5 beta 5 clientX/Y values MouseEvents are returned in screen
>> pixels.  In 1.5 beta 4 there were viewBox coordinates.
 
>> How do I get the viewBox coordinates again (from pixel coordinates)
>> ?  E.g. I draw an Overlay in pixel coordinates, but the coordinates
>> should be shown in a status bar as viewBox coordinates.

>> A little code example would be very nice.

>> thank you very much, Martin

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




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


Mime
View raw message