Here you can find the source of imageRotate(Image img, int angle)
public static BufferedImage imageRotate(Image img, int angle)
//package com.java2s; //License from project: Open Source License import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; public class Main { public static BufferedImage imageRotate(Image img, int angle) { BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = (Graphics2D) bi.getGraphics(); graphics.rotate(Math.toRadians(angle), 26, 26); graphics.drawImage(img, 0, 0, null); graphics.dispose();/* w w w .j a v a 2 s. c o m*/ return bi; } }