[
https://issues.apache.org/jira/browse/NETBEANS-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16849040#comment-16849040
]
Eirik Bakke commented on NETBEANS-1583:
---------------------------------------
I have concluded that it's better to support vectorized icons via SVG; see
https://issues.apache.org/jira/browse/NETBEANS-2604 . While the
MultiResolutionImage approach could be nice to support as well, SVG loading
support would make the latter lower-priority.
> Support MultiResolutionImage loading from ImageUtilities
> ---------------------------------------------------------
>
> Key: NETBEANS-1583
> URL: https://issues.apache.org/jira/browse/NETBEANS-1583
> Project: NetBeans
> Issue Type: Improvement
> Components: platform - Other
> Affects Versions: 10.0
> Environment: Windows, Linux, and MacOS
> Reporter: Eirik Bakke
> Priority: Minor
> Labels: HiDPI
>
> To look good on HiDPI/Retina displays, the NetBeans IDE, and NetBeans
> Platform (RCP) applications, will eventually need to provide high-resolution
> versions of various image asset (typically icons). In Swing, multi-resolution
> image assets are supported via the
> [MultiResolutionImage|https://docs.oracle.com/javase/10/docs/api/java/awt/image/MultiResolutionImage.html]
> class; such images are automatically loaded by methods such as
> Toolkit.getImage based on a standard naming convention. For instance, on
> MacOS, Toolkit.getImage("myicon.png") will also load the file "[email protected]"
> if present, returning a MultiResolutionImage (implemented in
> [JDK-8011059|https://bugs.openjdk.java.net/browse/JDK-8011059]). NetBeans'
> ImageUtilities.loadImage and friends should do the same.
> The same naming convention for multi-resolution image assets should be used
> as in the JDK. See Philip Race's comment on
> [JDK-8151787|https://bugs.openjdk.java.net/browse/JDK-8151787] :
> {quote}The proposed name convention for splash screens *and* other multi-res
> images is @125pct @150pct @200pct @2x @250pct @300pct @3x
> ie @2x and @3x are supported as synonyms for @200pct and @300pct respectively
> and also because we already supported @2x on retina Mac.
> {quote}
>
> On the naming convention, see also
> [JDK-8090575|https://bugs.openjdk.java.net/browse/JDK-8090575]. Also make
> sure to retain the ability to add a "_dark" suffix for dark LAFs.
> As far as I know, only MacOS currently supports the automatic loading of such
> assets via Toolkit.getImage, but both Windows and MacOS (and Linux?) support
> the underlying MultiResolutionImage class. So it's already possible to
> implement this on the latest JDK. Note, however, that we should probably wait
> for [JDK-8212226|https://bugs.openjdk.java.net/browse/JDK-8212226] to be
> fixed before enabling this on Windows.
> As part of this patch, other ImageUtilities methods such as
> createDisabledIcon, createDisabledImage, and mergeImages should also be
> updated to support both MultiResolutionImage and the new
> org.openide.util.VectorIcon class (introduced at
> https://github.com/apache/incubator-netbeans/pull/859/files ). Emilian Bold
> has done some work on this in the past; see
> https://github.com/emilianbold/nextbeans/commit/0f99dba0c1b3e8e0bc4e7cec407b53d30e85ead1
> . Eirik Bakke also has a [Pull
> Request|https://github.com/apache/incubator-netbeans/pull/998] for
> createDisabledIcon in particular, which works with the VectorIcon class and
> any other Icon instance.
> Last, note that there are two ways to create icons that look good on HiDPI
> displays: either by using MultiResolutionImage, or by hand-painting vector
> graphics in a custom implementation of the Icon class. This issue deals with
> the MultiResolutionImage approach; the vector painting approach is supported
> via the existing helper class org.openide.util.VectorIcon. Both approaches
> are valid and should be supported by the NetBeans Platform. (Update on
> 2019-05-27: There's a third approach, which is to supply each icon as an SVG
> file. That one is probably the better approach. See
> https://issues.apache.org/jira/browse/NETBEANS-2604 .)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists