Here you can find the source of flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage)
private static BufferedImage flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage)
//package com.java2s; import java.awt.image.BufferedImage; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; public class Main { private static BufferedImage flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage) { // equivalent to rotating the image 180 degrees AffineTransform tx = AffineTransform.getScaleInstance(-1, -1); tx.translate(-srcImage.getWidth(null), -srcImage.getHeight(null)); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); return op.filter(srcImage, null); }/*from w ww. j a va2 s . c o m*/ }