views:

47

answers:

1

I use the AffineTransform when drawing with Graphics2D. I use it to transform a Shape before drawing it. rx and ry are supposed to be rotation but when drawing the shapes are sheared not rotated. How can I enforce rotation? I tried using the default constructor then calling the rotate, scale and translate but the shapes looked nothing like they're supposed to look.

transform = new AffineTransform(sx, rx, ry, sy, tx, ty);
transform.createTransformedShape(shape); // Where shape is a GeneralPath instance
+1  A: 

Read Applying Affine Transformation to Images article.

You need to use rotate method to get correct rotation.

Roman