int wideth=src.getWidth(null); //得到源图宽 int height=src.getHeight(null); //得到源图长 //System.out.println(wideth); //System.out.println(height); //BufferedImage tag = new BufferedImage(wideth/2,height/2,BufferedImage.TYPE_INT_RGB); //tag.getGraphics().drawImage(src,0,0,wideth/2,height/2,null); //绘制缩小后的图
BufferedImage tag = new BufferedImage(wideth/num,height/num,BufferedImage.TYPE_INT_RGB); tag.getGraphics().drawImage(src,0,0,wideth/num,height/num,null); //绘制缩小后的图