<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v3]

Alexey Ivanov aivanov at openjdk.java.net
Fri Apr 30 20:40:58 UTC 2021


On Thu, 29 Apr 2021 18:47:27 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1044:
>> 
>>> 1042:                         new BufferedImage(iconSize, iconSize, BufferedImage.TYPE_INT_ARGB);
>>> 1043:                 img.setRGB(0, 0, iconSize, iconSize, iconBits, 0, iconSize);
>>> 1044:                 return img;
>> 
>> There are cases where the size of the buffered image is different from the requested size. It could affect the layout because it breaks the assumption that the returned image has the requested size but it may be larger. (Or is it no longer possible?) I think it should be wrapped into `MultiResolutionIconImage` in this case.
>
> Actually in makeImage we do not use requested size, we return the bits that system returns to us. How the generated image is treated depends on the implementation of the public methods - where it matters they are wrapped in the corresponding multi resolution images so it behaves correctly in UI.

Okay, if it *always* wrapped in a multi-resolution image where it *matters*.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875


More information about the awt-dev mailing list