Here you can find the source of flipVertically(BufferedImage source)
Parameter | Description |
---|---|
source | The source image. |
public static BufferedImage flipVertically(BufferedImage source)
//package com.java2s; //License from project: Apache License import java.awt.Graphics2D; import java.awt.image.BufferedImage; public class Main { private static BufferedImage bimg; private static Graphics2D g2; private static int w; private static int h; /**//from w w w .j av a 2s . c om * Flips a given image vertically. * @param source The source image. * @return BufferedImage */ public static BufferedImage flipVertically(BufferedImage source) { w = source.getWidth(); h = source.getHeight(); bimg = new BufferedImage(w, h, source.getType()); g2 = bimg.createGraphics(); g2.drawImage(source, 0, 0, w, h, 0, h, w, 0, null); g2.dispose(); return bimg; } }