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

Sheared Image after refresh shows different image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.2.0
    • client-libs
    • None
    • 2d
    • 1.2beta
    • 1.2beta
    • sparc
    • solaris_2.5.1
    • Verified

      The sheared image is drawn correctly. After the window is refreshed. The image bounds is filled with more of the image.


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

      public class shear extends Canvas
      {
          Image img1;

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

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

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

              g.drawString("400,100", 400, 100);

              AffineTransform at = new AffineTransform(1,0,.2,1,0,0);
              at.translate( 100, 100);
              g2.drawImage(img1, 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 shear());
              f.pack();
              f.show();
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: