Hi,

A work around would be to use a custom protocol handler (I assume JavaFX
loads the image using URL.openConnection/openStream) who loads the file,
runs it through Batik and returns a stream with the rendered image.

An URL might look like this:

svg:file:/path/to/myfile.svg?size=16x16

and if the above assumption holds true then JavaFX does not even notice
what's going on ;-)

The only a caveat is that this is not working with CSS and relative URLs
in there.

Tom

On 11.10.16 15:37, Cirujano Cuesta, Diego wrote:
> Hi Kevin,
> 
> is there any public API that allow adding new Image formats?
> 
> Thank you,
> Diego
> 
> -----Original Message-----
> From: Kevin Rushforth [mailto:kevin.rushfo...@oracle.com] 
> Sent: Dienstag, 11. Oktober 2016 14:36
> To: Cirujano Cuesta, Diego <diego.cirujano-cue...@zeiss.com>
> Cc: openjfx-dev@openjdk.java.net
> Subject: Re: SVG
> 
> JavaFX supports SVG paths both directly and via CSS, but there is no general 
> support for SVG.
> 
> As for you other question, unless they use public API they will no longer 
> work. Applications can export internal packages via a command line switch, 
> but it is quite fragile and not likely to work from release to release.
> 
> -- Kevin
> 
> 
> Cirujano Cuesta, Diego wrote:
>> Hi all,
>>
>> I was wondering why there is no javafx support to svg, is there any reason? 
>> I found nice the solution from codecentric interesting: 
>> https://github.com/codecentric/javafxsvg. But it uses 
>> com.sun.javafx.iio.ImageFormatDescription, com.sun.javafx.iio.ImageLoader, 
>> com.sun.javafx.iio.ImageStorage and com.sun.javafx.iio.ImageLoaderFactory. 
>> in openjfx9 is still there in com.sun... What's going to happen to these 
>> classes in Java 9? Is there strategy about providing ways to use them?
>>
>> Thanks!
>> Diego
>>   


-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck

Reply via email to