import java.awt.image.BufferedImage; import java.awt.Graphics2D;
public static BufferedImage resize(BufferedImage source, int width, int height){ BufferedImage out = new BufferedImage(width, height, source.getType()); Graphics2D g2d = out.createGraphics(); g2d.drawImage(source, 0, 0, width, height, null); g2d.dispose(); return out; }
修改前
before
以 resize(source, 200, 200) 修改後
edit with resize(source, 200, 200)
沒有留言 :
張貼留言