Java BufferedImage Trim trim(BufferedImage image, int trimTop, int trimLeft, int trimBottom, int trimRight)

Here you can find the source of trim(BufferedImage image, int trimTop, int trimLeft, int trimBottom, int trimRight)

Description

trim

License

Open Source License

Declaration

public static BufferedImage trim(BufferedImage image, int trimTop, int trimLeft, int trimBottom,
        int trimRight) 

Method Source Code

//package com.java2s;

import java.awt.image.BufferedImage;

public class Main {

    public static BufferedImage trim(BufferedImage image, int trimTop, int trimLeft, int trimBottom,
            int trimRight) {
        int width = image.getWidth();
        int height = image.getHeight();
        return image.getSubimage(trimLeft, trimTop, width - trimLeft - trimRight, height - trimTop - trimBottom);
    }//from w  w  w  . ja  v  a2 s  .c o m
}

Related

  1. trim(BufferedImage image)
  2. trim(BufferedImage image)
  3. trim(BufferedImage image, Rectangle trimRect)
  4. trim(BufferedImage img)
  5. trim(final BufferedImage img)
  6. trimAroundCenter(BufferedImage img, Point center, Color bgColor)