Problems rotating BufferedImage
问题 I have some problems with rotating images in Java using the AffineTransform class. I have the following method for creating a rotated (90 degrees) copy of an image: private BufferedImage createRotatedCopy(BufferedImage img, Rotation rotation) { int w = img.getWidth(); int h = img.getHeight(); BufferedImage rot = new BufferedImage(h, w, BufferedImage.TYPE_INT_RGB); double theta; switch (rotation) { case CLOCKWISE: theta = Math.PI / 2; break; case COUNTERCLOCKWISE: theta = -Math.PI / 2; break;