Java BufferedImage Flip verticalFlip(BufferedImage img)

Here you can find the source of verticalFlip(BufferedImage img)

Description

vertical Flip

License

Open Source License

Declaration

public static BufferedImage verticalFlip(BufferedImage img) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Graphics2D;

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage verticalFlip(BufferedImage img) {
        int w = img.getWidth();
        int h = img.getHeight();
        BufferedImage flippedImage = new BufferedImage(w, h, img
                .getColorModel().getTransparency());
        Graphics2D g = flippedImage.createGraphics();
        g.drawImage(img, 0, 0, w, h, 0, h, w, 0, null);
        g.dispose();//from w  w w.j a  v  a  2  s  .  co m
        return flippedImage;
    }
}

Related

  1. flipVertically(BufferedImage image)
  2. flipVertically(BufferedImage image, RenderingHints hints)
  3. flipVertically(BufferedImage source)
  4. horizontalflip(BufferedImage img)
  5. verticalFlip(BufferedImage img)