1 2 | import java.awt.image.BufferedImage; import java.awt.Graphics2D; |
1 2 3 4 5 6 7 | 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)

沒有留言 :
張貼留言