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

Alexander Zuev kizune at openjdk.java.net
Thu Apr 29 18:49:55 UTC 2021

On Wed, 10 Mar 2021 20:17:05 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Fix updated after first round of review.
> 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.


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

More information about the awt-dev mailing list