-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
None
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();
}
}
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();
}
}