<AWT Dev> <Swing Dev> [10] Review request for 8182043: Access to Windows Large Icons

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Oct 23 23:22:17 UTC 2017

On 17/10/2017 09:42, Alexey Ivanov wrote:
>> This is my understanding, before those fix the maximum size was 32x32.
> It is my understanding too. Thus limiting the size of icon to 128 pixels 
> seemed reasonable.
> At this moment the buffer for icon pixels is allocated on the stack, 
> therefore the size cannot be dynamic. If memory for icon pixels is 
> allocated dynamically, the limitation can be removed.
> It makes sense to address this limitation under a separate issue, do you 
> agree?

I agree that this can be moved to a separate bug. But my complaints were 
not related to it.
  - The new flags are not strictly specified. It is unclear what are 
small and large icons. For example the old "getSystemIcon" specified 
that it returns "an icon as it would be displayed by a native file 
chooser". How the new flags are related to this? I see that the SMALL 
flag is the same as the old method, and the large cion is just a HiDPI 
version of default icon.
  - SMALL/LARGE flags depends from the native main screen scale, 
probably it is possible to remove this dependency? Otherwise in the two 
screen configuration it will produce different images depending from the 
main screen.
  - In case of multi-monitor config in the discussion above there was a 
suggestion that the user can create MRI on top of the new API. I am not 
sure how it will work because we already return MRI for most of the files.

I am still thinking that we should investigate the possibility to return 
MRI directly w/o ImageIcon/Icon wrappers. This MRI could load data 
lazily depends from the destination scale. The user ill able to get any 
resolution variants via getResolutionVariant(double,double) and also can 
get the list of the icons attached to some file via getResolutionVariants();

> Regards,
> Alexey
>>>>> But these constants are related to the predefined system icon sizes 
>>>>> while the Extract() may scale icon to any size.
>>>> Does it really scale for any size?
>>>> For example if I request the icon for some pdf,java,txt files of 
>>>> size 100 then:
>>>>   - On HiDPI screen I get the native icon of size 64.
>>>>   - On LowDPI screen I get the native icon of size 32.
>>>> In both cases the user will get MRI, which will scale the native icon.
>>>> http://mail.openjdk.java.net/pipermail/awt-dev/2017-October/013179.html
>>> Why returning MRI is wrong?
>> The MRI is good, if this is what the user is expected. My point was 
>> that the native system is not scale the icon and the user gets MRI 
>> which content is unrelated to the passed "size".
>>> Which calls are you talking about DPI-aware or DPI-unaware?
>> This is jdk10client + the current patch.

Best regards, Sergey.

More information about the awt-dev mailing list