Java examples for 2D Graphics:BufferedImage Rotate
rotate Image 180
/*/*from w w w .j ava2 s . c om*/ * Copyright 2000-2013 Enonic AS * http://www.enonic.com/license */ //package com.java2s; import java.awt.image.BufferedImage; public class Main { public static BufferedImage rotateImage180(BufferedImage image, final int bufferedImageType) { return rotateImage90(rotateImage90(image, bufferedImageType), bufferedImageType); } public static BufferedImage rotateImage90(BufferedImage image, final int bufferedImageType) { int width = image.getWidth(); int height = image.getHeight(); BufferedImage destImage = new BufferedImage(height, width, bufferedImageType); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { destImage.setRGB(height - 1 - j, i, image.getRGB(i, j)); } } return destImage; } }