BufferedImage tag;
Image image = bi.getScaledInstance(srcWidth, srcHeight,Image.SCALE_DEFAULT);
// 四个参数分别为图像起点坐标和宽高
// 即: CropImageFilter(int x,int y,int width,int height)
cropFilter = new CropImageFilter(x, y, width, height);
img = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(image.getSource(), cropFilter));
int type = BufferedImage.TYPE_INT_ARGB;
tag = new BufferedImage(width, height,type);
Graphics2D g = (Graphics2D)tag.getGraphics();