<Swing Dev> SVG support for Swing icons etc.? (Useful for HiDPI)
Philip Race
philip.race at oracle.com
Thu Sep 22 17:34:05 UTC 2016
There is no work currently planned along those lines.
If there were it would be JDK10 at the earliest.
The alternative is that you custom render the exact size that is
needed onto a BufferedImage using Graphic2D calls and hand that over.
Granted it is not the same as bundling an SVG resource with your app
but it doesn't depend on any unplanned work.
-phil.
On 9/22/16, 10:10 AM, Eirik Bakke wrote:
> Hi, swing-dev.
>
> I see there's a lot of work going on to make Swing work well with
> HiDPI/Retina displays, including the new MultiResolutionImage API (
> http://openjdk.java.net/jeps/251 ).
>
> It's now up to application developers to provide icons and other image
> assets in multiple resolutions. My bet is that many of these newly
> designed assets are going to be designed as vector art (e.g. Adobe
> Illustrator), which will currently need to be manually rasterized down
> to PNG files of the different required resolutions.
>
> Are there any plans or existing RFEs for allowing Swing to load SVG
> files from its existing APIs (e.g. "new ImageIcon(URL)")? I searched
> the OpenJDK JIRA and JEP 251 but could not find any mention of this. I
> think SVG support would make it easier for application developers to
> supply icons that look good at all resolutions. SVG support is now
> standard in all the big web browsers.
>
> Some existing approaches involving use of the external Batik library
> can be seen on
> http://stackoverflow.com/questions/2495501/swing-batik-create-an-imageicon-from-an-svg-file .
>
> -- Eirik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160922/955462ed/attachment.html>
More information about the swing-dev
mailing list