`
fandayrockworld
  • 浏览: 308882 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

切割图片

 
阅读更多
public static void main(String[] agrs) {
		try {
			BufferedImage img = ImageIO.read(new File("D:\\Program Files\\myftp\\3.jpg"));
			int w = img.getWidth();
			int h = img.getHeight();
			
			BufferedImage subImg = img.getSubimage(0, 0, w/2, h/2);
			
			ImageIO.write(subImg, "jpg", new File("D:\\Program Files\\myftp\\new.jpg"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics