xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <David.Sm...@aeroint.com>
Subject Success!
Date Mon, 03 Dec 2001 16:41:01 GMT
For newbies the world over, Christophe Jolife was right!!

Here is how you display an image in SVG


     svgRoot.setAttributeNS(null, "xmlns", "http://www.w3.org/2000/svg");
      svgRoot.setAttributeNS("xmlns", "xlink",
"http://www.w3.org/1999/xlink");

      
      Element e = doc.createElementNS(svgNS, "image");
      e.setAttributeNS(null, "x", "200" );
      e.setAttributeNS(null, "y", "200" );
      e.setAttributeNS(null, "width", "50" );    
      e.setAttributeNS(null, "height","70" );   

	    String url = "graphics/z.gif" ;
      //MaintanenceChartBuilder mcb = new MaintanenceChartBuilder();
      ClassLoader cl = this.getClass().getClassLoader();
      URL fullUrl = cl.getResource(url);
      //e.setAttributeNS("xlink", "href", fullUrl.toString() );  // doesnt
work
      e.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
fullUrl.toString()); // works!!

*sigh_of_relief*

DS

************************************************************************
This Internet E-mail is intended solely for the person to whom it is addressed. It may contain
confidential or privileged information. If you have received it in error please notify us
immediately by telephone and destroy the transmission. You must not copy, distribute or take
any action in reliance on it.

Aerosystems International               Phone: +44 (0)1935 443000
                                        Fax  : +44 (0)1935 443111
                                        Web  : www.aeroint.com
************************************************************************

---------------------------------------------------------------------
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