I want to display a SVG image with "Scalable 2D Vector Graphics API". I have created the image by converting a JPG image into SVG. I use it as an icon for a Symbian C++ app and it gets shown there. But I get this error when I try to display the image in a midlet:
org.w3c.dom.DOMException: error.invalid.trait.value([0] fill-rule, [1] nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;, [2] g(Ebene_x0020_1), [3] http://www.w3.org/2000/svg)
I try do display other SVG images that I found on the webb. This results in no error, but no image is ever shown. What do I have to do to get the SVG images to be shown? This my code:
init method:
sg = ScalableGraphics.createInstance();
sg.setRenderingQuality(sg.RENDERING_QUALITY_HIGH);
try {
InputStream svgStream =
getClass().getResourceAsStream("tiger.svg");
svgImage = (SVGImage) (SVGImage.createImage(svgStream, null));
svgImage.setViewportWidth(100);
svgImage.setViewportHeight(100);
paint method:
sg.bindTarget(g);
sg.setTransparency(1f);
sg.render(0, 0, svgImage);
sg.releaseTarget();

Reply With Quote

