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; }
图片缩放
最新推荐文章于 2021-12-27 20:13:17 发布