Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding image namespace in svg through JS still doesn't show me the picture

2 views
Skip to first unread message

Tamer Higazi

unread,
Jul 31, 2011, 10:08:43 PM7/31/11
to
after working out getting the parameter through a scaled version of a
picture, I am trying through Javascript adding the picture with the
original size parameter in SVG.

Firebug shows me the element, and all the necessary parameter, but
with best wishes I am not getting through to get the image itself
being displayed

this.svg = document.getElementsByTagNameNS('http://www.w3.org/2000/
svg','svg');
var bild = document.createElementNS('http://www.w3.org/2000/
svg','image');
var BildURL = this.image[0][0].getAttribute('xlink:href');
var imgX = new Image();
imgX.src = BildURL;

bild.setAttribute("x","60");
bild.setAttribute("y","40");
bild.setAttribute("width",imgX.width);
bild.setAttribute("height",imgX.height);
bild.setAttribute("id","image12976");
bild.setAttribute("xlink:href",BildURL);
this.svg[0].appendChild(bild);

If i take a look in Firebug, the element fully exists.

Any ideas to solve it?!


for any advises, I would kindly thank you.


Tamer

Tamer

0 new messages