getSubimage方法是进行图片裁剪。
举例:
public static void main(String[] args) {
try {
//从特定文件载入
BufferedImage bi = ImageIO.read(new File("c:\\test.jpg"));
bi.getSubimage(0, 0, 10, 10);//前两个值是坐标位置X、Y,后两个是长和宽
} catch (IOException e) {
e.printStackTrace();
}
}
没有处理过,文档里说了共享同样的数据
Returns a subimage defined by a specified rectangular region.
The returned BufferedImage shares the same
data array as the original image.
先保存一份 要用的时候,随时再拿来用