0
我有以下類如何將分辨率降低到沒有寬鬆dpi的圖像?
public void resize(InputStream input, OutputStream output, int width, int height) throws IOException {
BufferedImage src = ImageIO.read(input);
BufferedImage dest = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = dest.createGraphics();
AffineTransform at = AffineTransform.getScaleInstance((double)width/src.getWidth(), (double)height/src.getHeight());
g.drawRenderedImage(src, at);
ImageIO.write(dest, "tif", output);
output.close();
}
,但最終的結果,我輸在1 DPI我怎麼能保持dpi的圖像中?