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

GraphicsContext - should allow to control interpolation when drawing images

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • tbd
    • 7u15
    • javafx
    • Windows 7 64bit, JDK 1.7.0_15 64bit, JavaFX 2.2.7 64bit, NetBeans 7.3 64bit

    Description

      When drawing an image in a GraphicsContext using the drawImage() method to enlarge a small image to a larger canvas, the image is being interpolated (possibly using a bilinear or bicubic algorithm).
      But there are times like when rendering color maps (temperature, zooplancton, salinity, etc.) or some geographical data (population concentration, etc.) where we want to have no interpolation at all (ie: use the nearest neighbor algorithm instead) in order to represent accurate data and shapes.

      In Java2D, this is possible by setting the appropriate RenderingHints.KEY_RENDERING on the Graphics2D at hand.
      Currently on JavaFX's GraphicsContext there is no such way to specify how the image is to be interpolated.

      The same applies when shrinking images too.

      This could be expanded to support a better form of smoothing for the "smooth" value that is available in both Image and ImageView and that does not seem to work very well currently (at least on Windows).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fbouyajfx Fabrice Bouyé (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: