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

Specifying desired dimensions for Image with HiDPI (@2x) variant gets the size wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • None
    • javafx
    • None
    • 8

      If you have an image with a HiDPI variant (filename with @2x modifier) and you specify the desired dimensions for the image in the constructor, that image will be loaded at half size on a HiDPI screen.

      This is due to a mismatch for how the desired dimensions are managed when a scaled version of the image is loaded.

      Run the attached program ThumbnailDPITest on a Mac with retina screen, or a high resolution Windows 8.1 or Windows 10 device to see that the high resolution "thumbnail" (labeled "High") is half the size of the thumbnail created from the image with no HiDPI variaent (labeled "Only"). If you see an image labeled "Low", then you are not running on a high-DPI screen.

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: