Hi!
I also had this problem.
According to jsr266 documentation, you SHOULD use special class ExternalResourceHandler if you want to render svg files with png (and any other external resources).
I suppose you have SVG examples which are included into WTK 2.5.
Try to add the following code into example "RenderSVGImageDemo.java":
public class PngLoader implements ExternalResourceHandler
{
public void requestResource(ScalableIm
Class c = RenderSVGImageDemo.class;
InputStream is = c.getResourceAsStream("/st
//struct-image-01.png must be in "res" directory of your MIDlet
try {
image.requestCompleted(uri
} catch (IOException e) {
e.printStackTrace();
}
}
}
When creating image, use this class:
SVGImage svgImage = (SVGImage)SVGImage.createI
My svg file is:
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphic
<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2
<g id="test-body-content">
<image id="image1PNG" x="240" y="150" width="240" height="150" xlink:href="struct-image-0
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>
----------------------
And it draws fine this png image...
Best regards,
Vasily.
Main Topics
Browse All Topics





by: jimmackPosted on 2007-09-07 at 15:39:12ID: 19851502
I don't know anything about SVG on J2ME, but the error message seems to be indicating that you need a colon in the URL for your image. If a colon is required and it's a URL, I would assume that you're going to need to use something more like:
http://..../RBS.png