uck*_*man 10
如果src是a BufferedImage,则可以从中剪切矩形(x1,y1)-(x2,y2)并将其写为dst.png:
final BufferedImage dst = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g = dst.createGraphics();
g.drawImage(src, x1, y1, x2, y2, null);
g.dispose();
ImageIO.write(dst, "PNG", new FileOutputStream("dst.png"));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6617 次 |
| 最近记录: |