Example usage for java.awt.geom AffineTransform getQuadrantRotateInstance

List of usage examples for java.awt.geom AffineTransform getQuadrantRotateInstance

Introduction

In this page you can find the example usage for java.awt.geom AffineTransform getQuadrantRotateInstance.

Prototype

public static AffineTransform getQuadrantRotateInstance(int numquadrants, double anchorx, double anchory) 

Source Link

Document

Returns a transform that rotates coordinates by the specified number of quadrants around the specified anchor point.

Usage

From source file:Main.java

public static void main(String[] args) throws java.io.IOException {
    BufferedImage img = ImageIO.read(new File("input-image.png"));

    BufferedImage rotated = new AffineTransformOp(
            AffineTransform.getQuadrantRotateInstance(3, img.getWidth() / 2, img.getHeight() / 2),
            AffineTransformOp.TYPE_BILINEAR).filter(img, null);

    ImageIO.write(rotated, "PNG", new File("output-image.png"));
}