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 Müller Clemens <cl...@gmx.at> on 2010/08/12 22:20:30 UTC

yardstick/scale component for a JSVGCanvas

hello!

i am showing the floor map of a house on a JSVGCanvas and i want to add a yardstick/scale overlay (like the one shown at google maps in the bottom left corner).

can you tell me how to implement such a component? i couldn't find any convenient method to get the actual pixel size of an element of the SVGDocument.

my attempt is to draw a rect element in the floor plan canvas which has a predefined size of, lets say, 100mm. after each zoom behavior i get the actual size (in pixels) of the drawn element. then i need the information how broad the actual drawn JSVGCanvas is in pixels and so i can calculate the corresponding length of a, lets say, 200px wide component. the problem is, that i couldn't find any method for getting the actual rendered with of a component in pixels.

can you help me about getting the comonents' size or do you know a better solution for my problem?

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