Java BufferedImage Rotate rotateMyImage(BufferedImage img, double angle)

Here you can find the source of rotateMyImage(BufferedImage img, double angle)

Description

rotate My Image

License

Apache License

Declaration

public static BufferedImage rotateMyImage(BufferedImage img,
            double angle) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage rotateMyImage(BufferedImage img,
            double angle) {
        int width = img.getWidth();
        int height = img.getHeight();
        BufferedImage newImage = new BufferedImage(height, width,
                img.getType());/*  w  w  w.j  av  a  2 s . com*/

        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;
    }
}

Related

  1. rotateImageLeft90( BufferedImage bufferedimage)
  2. rotateImageRect(final BufferedImage image, final int degrees)
  3. rotateImages(BufferedImage imgs[], double angle)
  4. RotateLeft(BufferedImage bi)
  5. rotateLeft(BufferedImage image, RenderingHints hints)