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

Rotated image bounds contains distorted previously drawn image

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.0
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Introduced In Build:
      1.2beta
    • Introduced In Version:
    • Resolved In Build:
      1.2beta
    • CPU:
      sparc
    • OS:
      solaris_2.5.1
    • Verification:
      Verified

      Description

      Drawing a translated scaled image, then drawing a translated rotated image. The translated rotated image is drawn, but inside the bounds of this image contains a distorted look of the previously drawn translated scaled image.

      import java.awt.*;
      import java.awt.geom.AffineTransform;

      public class test extends Canvas
      {
          Image img1, img2;

          public test()
          {
              setBackground(Color.white);

              img1 = getToolkit().getImage("image3.gif");
              img2 = getToolkit().getImage("image4.gif");
          }

          public void paint(Graphics g)
          {
              Graphics2D g2 = (Graphics2D) g;

              int x = getSize().width;
              int y = getSize().height;

              AffineTransform at = new AffineTransform();
              at.translate( 10.0, 10.0);
              at.scale(1, 2);
              g2.drawImage(img1, at, this);

              at = new AffineTransform();
              at.translate( 200, 10);
              at.rotate((45*java.lang.Math.PI)/180);
              g2.drawImage(img2, at, this);
         }

          public static void main(String s[])
          {
              Frame f = new Frame("Java 2D Test Product");
              f.setSize(new Dimension(800,600));
              f.add("Center", new test());
              f.pack();
              f.show();
          }
      }

        Attachments

          Activity

            People

            Assignee:
            jehung Jeannette Hung
            Reporter:
            blichtensunw Brian Lichtenwalter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: