You are on page 1of 1

int areaH = y2 - y1; BufferedImage img = ImageIO.read(inputImage); int areaW = img.getWidth(); img = img.

getSubimage(0, y1, areaW, areaH); File outputfile = new File(outputDir + File.separator + "Line_" + nu m + ".png"); ImageIO.write(img, "png", outputfile); num++;