RFR: 8282526: Default icon is not painted properly

Alexander Zuev kizune at openjdk.java.net
Sun Mar 13 21:16:07 UTC 2022


On Sun, 13 Mar 2022 21:06:24 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

> Detect the situation where we do need to perform interpolation during ImageIcon
> painting and set a hint to the rendering to perform bicubic approximation so
> image details are preserved during transition.

The icon returned by the system is 32x32 icon that looks like this:
![FileIcon](https://user-images.githubusercontent.com/69642324/158079313-800ba0de-d009-4b6a-8b08-de71bf18b106.png)
After approximation to the 16x16 with nearest neighbor  it now looks like this:
![FileIconNearest](https://user-images.githubusercontent.com/69642324/158079342-b1f111fd-7f9c-4eda-af59-59a25d236fb9.png)
So the significant details are lost and the resulting icon looks cropped. After the fix the icon in the test looks fine:
![FileIconBiqubic](https://user-images.githubusercontent.com/69642324/158079416-65cb3dcd-514f-4a9b-9677-c12ae9312792.png)

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

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



More information about the client-libs-dev mailing list