List of utility methods to do BufferedImage Rotate
BufferedImage | rotateLeft(BufferedImage image, RenderingHints hints) Rotates the image 90 degrees to the left AffineTransform rot270Transform = AffineTransform.getRotateInstance(3 * Math.PI / 2); rot270Transform.translate(-image.getWidth(), 0); AffineTransformOp op = new AffineTransformOp(rot270Transform, hints); return op.filter(image, null); |
BufferedImage | rotateMyImage(BufferedImage img, double angle) rotate My Image int width = img.getWidth(); int height = img.getHeight(); BufferedImage newImage = new BufferedImage(height, width, img.getType()); for (int i = 0; i < width; i++) for (int j = 0; j < height; j++) newImage.setRGB(height - 1 - j, i, img.getRGB(i, j)); return newImage; |