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

Alexander Zuev kizune at openjdk.java.net
Sat May 8 00:19:22 UTC 2021

On Fri, 30 Apr 2021 20:48:21 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Getting smaller icon is relevant in the case of the scaling. I do not think refactoring image caches from icons to multiresolution images will make code much cleaner - at the end we will have to extract images from the multiresolution image to repack them into different multiresolution image because the base size of the image will not be the same and it does matter in how they will be scaled on the different screens. And we still need to extract both images because sometimes small resolution image looks not like the large resolution one and for a reason - so small resolution image is not blurred by the small detail on the large icon when scaling on the low resolution screen.
> No, I can't see how it's relevant. If the scale factor is 100% and the requested icon size is 16, then 16×16 is used; if the window is moved to a monitor with scale factor 200%, then 32×32 icon is used for rendering which is already fetched and available in the multi-resolution image — perfect, there's the benefit.
> But when is it possible that the scale factor is less than 100%?
> If `JFileChooser` requests a large icon that is 32×32, then it will be used for rendering when the scale factor is 100%. When the scale factor is 200%, the icon of 64×64 is required but it's not available, instead there's 16×16 icon. For this icon to be used, the scale factor needs to be 50%.

Ok, changed so only the icons that are higher or same size as requested will be in the resulting set (unless size requested exceeds the maximum allowed quality, in this case only maximum quality variant will be provided).


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

More information about the awt-dev mailing list