Java Utililty Methods BufferedImage Clip

List of utility methods to do BufferedImage Clip

Description

The list of methods to do BufferedImage Clip are organized into topic(s).

Method

BufferedImageclip(BufferedImage image, int[] ul, int[] lr)
Clip the image
int imageWidth = image.getWidth(null);
int imageHeight = image.getHeight(null);
int w = lr[0] - ul[0];
int h = lr[1] - ul[1];
if ((ul[0] + w <= imageWidth) && (ul[1] + h <= imageHeight) && (w > 0) && (h > 0)) {
    return image.getSubimage(ul[0], ul[1], w, h);
System.err.println("Specified clip width/height:" + w + "/" + h + " outside of image width/height:"
...
BufferedImagesubImage(BufferedImage image, int x, int y, int width, int height)
Gets a subImage.
return image.getSubimage(x, y, width, height);
BufferedImagesubimage(BufferedImage src, int x, int y, int w, int h)
Returns a subimage of the given main image.
if (!SUBIMAGE ) {
    return newSubimage(src, x, y, w, h);
return src.getSubimage(x, y, w, h);