Image img=...
int width = img.getWidth(null);
int height = img.getHeight(null);
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
Graphics g = bi.getGraphics();
g.drawImage(img,0,0,width,height,null);
g.dispose();
File f = new File("c:\\images\\myimage.png");
ImageIO.write(bi, "png", f);
int width = img.getWidth(null);
int height = img.getHeight(null);
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
Graphics g = bi.getGraphics();
g.drawImage(img,0,0,width,height,null);
g.dispose();
File f = new File("c:\\images\\myimage.png");
ImageIO.write(bi, "png", f);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货