from what i understand, if my image is in the same folder as my program, i
only need to specify the filename. but i get a null pointer exception.. i am
sure that the image and the program is on the same folder.. here is the
code:
private void loadImage() {
try {
SVGDocument doc = svgCanvas.getSVGDocument();
Element mapLayer = doc.createElementNS(svgNS, "image");
imageLayer.setAttributeNS(null, "x", "0");
imageLayer.setAttributeNS(null, "y", "0");
imageLayer.setAttributeNS(null, "width", "260");
imageLayer.setAttributeNS(null, "height", "368");
imageLayer.setAttributeNS(XLINK_NAMESPACE_URI, "xlink:href",
"test.jpg");
svgRoot.appendChild(imageLayer);
} catch(Exception e) {
System.out.println(e.toString());
}
}
are ther any errors on the code?
--
View this message in context:
http://www.nabble.com/Error-importing-Images-into-an-image-tag--tf646195.html#a10434915
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]