Sorry, I forgot to include an easy way to launch the demo if you aren't using
Eclipse with the Pivot plugin. Add this to the SVGImageDemo class to launch it
as a standard Java app:
public static void main(String[] args) {
DesktopApplicationContext.main(SVGImageDemo.class, args);
}
On Sep 30, 2010, at 1:28 PM, Greg Brown wrote:
> Did the attachments come through OK? I got an error message from the mail
> server that the attachments were too large, but it didn't actually seem to
> reject the message.
>
> On Sep 30, 2010, at 1:23 PM, Greg Brown wrote:
>
>> Earlier today, I took a stab at wrapping SVG Salamander in a Pivot Image. It
>> was trivial to implement, and the results are staggering (IMO). See attached.
>>
>> The key classes are SVGImage, which wraps an instance of
>> com.kitfox.svg.SVGDiagram, and SVGImageSerializer, which knows how to read
>> an SVGImage from an InputStream.
>>
>> The sample application loads the image declaratively in BXML:
>>
>> <ImageView styles="{verticalAlignment:'top'}">
>> <image>
>> <bxml:include src="logo.svg"/>
>> </image>
>> </ImageView>
>>
>> The only thing the application needs to do to enable this is add a MIME type
>> and file extension mapping to BXMLSerializer:
>>
>> static {
>> BXMLSerializer.getMimeTypes().put(SVGImageSerializer.MIME_TYPE,
>> SVGImageSerializer.class);
>> BXMLSerializer.getFileExtensions().put(SVGImageSerializer.SVG_EXTENSION,
>> SVGImageSerializer.MIME_TYPE);
>> }
>>
>> That's it!
>>
>> There are obviously huge advantages to having SVG support in a Pivot
>> application, one of which is resolution independence: SVG images will scale
>> with the UI, whereas bitmapped images won't (try scaling the sample UI using
>> Control-Shift +/- for an example).
>>
>> Mark, great work on SVG Salamander. Would you consider including the
>> SVGImage and SVGSerializer classes in your project? That would make it much
>> easier for Pivot users to take advantage of.
>>
>> Greg
>>
>> <pivot_svgsalamander.zip>
>>
>> <pivot_svgsalamander.png>
>