Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8081698

Support for automatic icon size selection by DPI like on mobile platforms

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u45
    • javafx
    • x86_64
    • linux

      A DESCRIPTION OF THE REQUEST :
      JavaFX has support for Hi-DPI in version 8. But this only supports resizing of components, icons (bitmaps) are the same. JavaFX applications has blurred icons on monitors with Hi-DPI


      JUSTIFICATION :
      Because situation around desktop application is the same as in mobile world. Our desktop applications runse on computers from 96DPI to 360DPI and situation will be worse because we will have smaller devices with a higher resolution in a feature.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      All mobile platforms has support for automatic icon size selection by DPI. e.g. Android knows 6 DPIs
      ldpi: 120 dpi, size: 0.75xmdpi
      mdpi (Baseline): 160 dpi, size: 1×mdpi
      hdpi: 240 dpi, size: 1.5×mdpi
      xhdpi: 320 dpi, size: 2×mdpi
      xxhdpi: 490 dpi, size: 3×mdpi
      xxxhdpi: 640 dpi, size: 4×mdpi

      All icons could be stored in separated folders in resources:
      /ldpi
      /mdpi
      /hdpi
      /xhdpi
      /xxhdpi
      /xxxhdpi

      In each folder will be the same icons with the same filenames but different sizes by DPI requiremetns.

      JavaFX should automatick select by DPI which is available in Screen object correct icon folder and load icons.
      ACTUAL -
      JavaFX applications has blurred icons on monitors with Hi-DPI

      CUSTOMER SUBMITTED WORKAROUND :
      We have a few workarounds today:
      1) Use icons in FXML formats (this solution works only on simple icons and required higher effort)
      2) Create font which contains icons (like FontAwesomeFX)
      3) Create custom component which extends Image and adds automatic icon selection by DPI

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: