<Swing Dev> <AWT Dev> [10] Review request for 8182043: Access to Windows Large Icons
Alexey Ivanov
alexey.ivanov at oracle.com
Fri Oct 6 20:00:13 UTC 2017
Hi Sergey,
On 06/10/2017 20:38, Sergey Bylokhov wrote:
> On 10/6/17 09:53, Alexey Ivanov wrote:
>>> It is limitation of our implementation:
>>> https://bugs.openjdk.java.net/browse/JDK-8151385
>>> http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010777.html
>>
>> I see. And it can be changed, if deemed necessary, can't it?
>
> Yes we can.
>
>>> As far as I understand the bug above, it is possible that OS returns
>>> some other size.
>>
>> No, it is not.
>> In that bug icons are extracted from Image List which is created a
>> part of Toolbar:
>>
>> 1036 HWND hWndToolbar = ::CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
>>
>> Then an icon is extracted from that image list.
>> Obviously, Toolbar can create and creates, as the bug report shows,
>> its icon set of different size depending on the current DPI setting,
>> or rather the DPI settings of the main display.
>>
>> As for JOptionPane, the icons are loaded using ::LoadIcon which loads
>> icon of the default size only. Depending on the current DPI setting,
>> it may return icon of larger size.
>>
>>
>> Yet in this fix, the file icon is requested with explicit size. You
>> will get the size you requested.
>
> Probably we have some other bug in the fix, but unfortunately I cannot
> confirm behavior you describe. For example if I request the icon for
> some pdf,java.txt files of size 100m 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.
I tested it myself. For some reason, in some cases the icon looks crisp,
in other cases it is scaled:
At 200% the icons look this way:
Icon Java / JFileChooser Paint / Open dialog
This PC
DPI shortcut
In the second row, the icon is obviously correct because the small icon
is flat.
Regards,
Alexey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171006/ff91a028/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hbgmamicdmgelolp.png
Type: image/png
Size: 994 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171006/ff91a028/hbgmamicdmgelolp.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ocaadlodhdhkgeon.png
Type: image/png
Size: 2220 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171006/ff91a028/ocaadlodhdhkgeon.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pjfelinklmcmgdld.png
Type: image/png
Size: 2691 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171006/ff91a028/pjfelinklmcmgdld.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: midjlhnbgoiclgdp.png
Type: image/png
Size: 2698 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171006/ff91a028/midjlhnbgoiclgdp.png>
More information about the swing-dev
mailing list