Hi,

I am quite lost with Batik and specially with filters.
I try to add a filter after a drawImage but I do not think that's the right
way to achieve this. What should I do ?

Code :

//creating DOM and SVGGraphics
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String namespaceURI = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(namespaceURI, "svg", null);
SVGGraphics2D svgGraphics = new SVGGraphics2D(doc);

//first image (background Image)
BufferedImage bufImg = ImageIO.read(new File("bgImage.png"));
svgGraphics.drawImage(bufImg, 0, 0, null);
doc.setAttributeNS(null, "width", Integer.toString(bufImg.getWidth()));
doc.setAttributeNS(null, "height", Integer.toString(bufImg.getHeight()));

//add a copyright image on background
BufferedImage bufImgCopyRight = ImageIO.read(img);
svgGraphics.drawImage(bufImgCopyRight, x, y, null);

//TODO : here a filter should be applied
//to add shadow on this element (copyright image)
//HOW TO RETRIEVE THE LAST ELEMENT ????

doc.appendChild(svgGraphics.getRoot());
//Transcode and save



Thanks,


Guillaume.

Reply via email to