Hi Peppe,
http://www.carto.net/papers/svg/manipulating_svg_with_dom_ecmascript/index.shtml
contains a tutorial on how to manipulate the DOM with Javascript.
Althought this targets ECMAScript, the same methods also apply to Java.
In your example, the bbox does not really exist. It is a SVGRect object
(with x,y,width,height) properties. You need to add your new image
somewhere in the DOM, using methods like .appendChild() or
.insertBefore(). Be aware that images use the xlink namespace when you
specify the "href" attribute. You have to explicitly set the namespace
for this attribute, e.g.
image.setAttributeNS("http://www.w3.org/1999/xlink","href","myImage.png");
Hope this helps,
Andreas
Peppe wrote:
Hi, i have an Element "shape" and then i get its bbox in this way :
SVGRect shapeBound = ((SVGLocatable)shape).getBBox();
Now i want to add images (they are arrows in jpeg format) in some points of
bbox...how can i do this? is there a method to add image to bbox?
--
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093 Zurich, Switzerland
Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: [EMAIL PROTECTED]
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]