I have a graph which uses a lot of images. This graph is on my application and there is a provision to export this graph as SVG to be viewed in the browser. But my generated SVG xml does not contain the source for the image. It only has the tag
I want it to have source attribute also so that it can load the images.
I have tried the workaround of modifying the genearted svg and insert my image tag. But this does not sound very good sol. Please help…
Yes, the content of the image tag depends on how the JGoImage was defined. If the JGoImage is defined using a filename or a URL, that information will be output in the image tag and the image will be visible in an SVG viewer. However, if you have used setImage() to specify your image, that image data is not being written to the Image tag.
Northwoods does have a subclass of JGoImage (called JGoImage2) that will embed Base64 PNG image data in the image tag, but it requires the use of the javax.imageio package, and therefore also requires at least version 1.4 of the Java SDK.
You can download a zip file containing JGoImage2.java and Base64EncodingScheme.java (also required) from: