Here you can find the source of fakeAOI(final BufferedImage pImage, final Rectangle pSourceRegion)
public static BufferedImage fakeAOI(final BufferedImage pImage, final Rectangle pSourceRegion)
//package com.java2s; import java.awt.*; import java.awt.image.BufferedImage; public class Main { public static BufferedImage fakeAOI(final BufferedImage pImage, final Rectangle pSourceRegion) { if (pImage == null) { return null; }/*w ww . ja v a 2 s . c o m*/ if (pSourceRegion != null) { if (pSourceRegion.x != 0 || pSourceRegion.y != 0 || pSourceRegion.width != pImage.getWidth() || pSourceRegion.height != pImage.getHeight()) { return pImage.getSubimage(pSourceRegion.x, pSourceRegion.y, pSourceRegion.width, pSourceRegion.height); } } return pImage; } }