图片缩放

private BufferedImage reSizeImage(BufferedImage image,int width,int height){ AreaAveragingScaleFilter areaAveragingScaleFilter = new AreaAveragingScaleFilter(width, height); FilteredImageSource filteredImageSource = new FilteredImageSource(image.getSource(), areaAveragingScaleFilter); BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); Graphics graphics = bufferedImage.createGraphics(); graphics.drawImage(new ExComponent().createImage(filteredImageSource), 0, 0, null); return bufferedImage; }

你可能感兴趣的:(图片缩放)