日期:2014-05-20 浏览次数:20659 次
Image yourImg = Toolkit.getDefaultToolkit().createImage(ri.data); //ri.data就是个byte数组 BufferedImage img = new BufferedImage(ri.width, ri.height, BufferedImage.TYPE_INT_RGB); Boolean flag = img.getGraphics().drawImage(yourImg, 0, 0,ri.width,ri.height, null); FileOutputStream fos = new FileOutputStream("test1.jpg"); ImageIO.write(img, "jpg", fos); fos.close();
byte[] bytes = ri.data; FileOutputStream fos = new FileOutputStream("D://test1.jpg"); fos.write(bytes); fos.close();
------解决方案--------------------
mark
------解决方案--------------------
ImageIcon icon=new ImageIcon(new String(字节数组));