Here you can find the source of flipAroundX(BufferedImage image)
Parameter | Description |
---|---|
image | image to flip |
public static BufferedImage flipAroundX(BufferedImage image)
//package com.java2s; //License from project: Creative Commons License import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; import java.awt.image.BufferedImage; public class Main { /**//from ww w . j a v a 2 s . c o m * Flips the image horizontally * * @param image image to flip * @return Modified image */ public static BufferedImage flipAroundX(BufferedImage image) { // Flip the image vertically AffineTransform tx = AffineTransform.getScaleInstance(1, -1); tx.translate(0, -image.getHeight(null)); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); image = op.filter(image, null); return image; } }