We're building a client-side Java app in which we'd like to interchangeably use JPG, GIF, and SVG images as transparently as possible. So, for example, we could pass a GIF, JPEG, or SVG to a JButton to use as an icon, and it wouldn't care what the file format was.
There are a couple of possible solutions that we've come up with, and we're just wondering if anyone else can offer input: 1. Either write or utilize an SVG wrapper class that implements the javax.swing.Icon interface. This would allow us to pass either an ImageIcon object containing a GIF or JPEG, or an SVG wrapped in this class to objects, and they could be treated identically. Does anyone know if such a wrapper already exists? 2. Somehow derive a java.awt.Image object from a Batik-generated SVG object. The closest thing we can find among the Batik packages that might be able to do this is the getOffScreen method of the JGVTComponent class, though it's not clear to us exactly how the offscreen image is to be generated since it doesn't seem to be created by default. Is there another method for deriving an Image object from an existing Batik SVG object that we're not seeing? Does this seem like a viable solution to our problem? Many thanks in advance for any input. Regards, Todd Wilson --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
