Java BufferedImage Rotate rotateImageLeft90( BufferedImage bufferedimage)

Here you can find the source of rotateImageLeft90( BufferedImage bufferedimage)

Description

rotate Image Left

License

Open Source License

Declaration

public static BufferedImage rotateImageLeft90(
        BufferedImage bufferedimage) 

Method Source Code

//package com.java2s;

import java.awt.Graphics2D;

import java.awt.RenderingHints;

import java.awt.image.BufferedImage;

public class Main {

    public static BufferedImage rotateImageLeft90(
            BufferedImage bufferedimage) {
        int w = bufferedimage.getWidth();
        int h = bufferedimage.getHeight();
        int type = bufferedimage.getColorModel().getTransparency();
        BufferedImage img;//  ww  w.j  av a  2 s . c  o  m
        Graphics2D graphics2d;
        (graphics2d = (img = new BufferedImage(h, w, type))
                .createGraphics()).setRenderingHint(
                RenderingHints.KEY_INTERPOLATION,
                RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        graphics2d.rotate(Math.toRadians(270), w / 2, h / 2 + (w - h) / 2);
        graphics2d.drawImage(bufferedimage, 0, 0, null);
        graphics2d.dispose();
        return img;
    }
}

Related

  1. rotateImage(BufferedImage src, double degrees)
  2. rotateImage(final BufferedImage image, final double theta)
  3. rotateImage(final BufferedImage savedImage, final int angle)
  4. rotateImage(final BufferedImage src, final double degrees)
  5. rotateImage180(BufferedImage image, final int bufferedImageType)
  6. rotateImageRect(final BufferedImage image, final int degrees)
  7. rotateImages(BufferedImage imgs[], double angle)
  8. RotateLeft(BufferedImage bi)
  9. rotateLeft(BufferedImage image, RenderingHints hints)