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

Image scaling is bad with D3D pipeline

XMLWordPrintable

    • 2d
    • 9
    • x86
    • other

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 10

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      4K monitor

      A DESCRIPTION OF THE PROBLEM :
      Java 9 distorts BufferedImages when it automatically resizes screens. I'm suspecting it has something to do with this ==> http://openjdk.java.net/jeps/263 being delivered in Java 9.

      Related question asked on Stack Overflow with example output==>https://stackoverflow.com/questions/46736757/disable-automatic-rescaling-of-bufferedimage-in-jdk9

      REGRESSION. Last worked in version 8u144

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute attached source code on Windows 10 using Java 9.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Lines in buffered image should alternate between back and white (using attached source code)
      ACTUAL -
      Distortion of lines occur in a triangular pattern

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args){
              JFrame frame=new JFrame("Java version 9");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              BufferedImage image =new BufferedImage(800,600,BufferedImage.TYPE_INT_RGB);
              Graphics2D g=image.createGraphics();
              g.setColor(Color.WHITE);
              for(int y=0;y<image.getHeight();y+=2){
                  g.drawLine(0,y,image.getWidth(),y);
              }
              g.dispose();
              ImageIcon imageIcon=new ImageIcon(image);
              JLabel label=new JLabel(imageIcon);
              frame.add(label);
              frame.pack();
              frame.setVisible(true);
          }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't upgrade to Java 9

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: