adding image namespace in svg through JS still doesn't show me the picture
Tamer Higazi <[email protected]> Sun, 31 Jul 2011 19:08:39 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.svg |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <39e436b2-d178-4fc9-b115-1df0989f6cb7@l37g2000yqd.googlegroups.com> |
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