Java Utililty Methods Image Cut

List of utility methods to do Image Cut

Description

The list of methods to do Image Cut are organized into topic(s).

Method

voidcutImage(String src, String dest, int x, int y, int w, int h)
cut Image
Iterator iterator = ImageIO.getImageReadersByFormatName("jpg");
ImageReader reader = (ImageReader) iterator.next();
InputStream in = new FileInputStream(src);
ImageInputStream iis = ImageIO.createImageInputStream(in);
reader.setInput(iis, true);
ImageReadParam param = reader.getDefaultReadParam();
Rectangle rect = new Rectangle(x, y, w, h);
param.setSourceRegion(rect);
...
booleancutImage(String src, String dest, int x, int y, int w, int h)
cut Image
try {
    Iterator iterator = ImageIO.getImageReadersByFormatName("jpg");
    ImageReader reader = (ImageReader) iterator.next();
    InputStream in = new FileInputStream(src);
    ImageInputStream iis = ImageIO.createImageInputStream(in);
    reader.setInput(iis, true);
    ImageReadParam param = reader.getDefaultReadParam();
    x = (x > 0 ? x : 0);
...