BufferedImage bufferedImage = ImageIO.read(new File("/...icon.jpg"));
// this writes the bufferedImage into a byte array called resultingBytes
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "jpg", byteArrayOut);
byte[] resultingBytes = byteArrayOut.toByteArray();
我使用上面的代碼來獲取JEPG圖像作爲字節數組。我想知道這個字節數組究竟是什麼。這個數組是否包含任何文件頭信息或像素值?例如,如果我想扭轉此圖像的顏色,那麼這樣做的好方法是什麼? 非常感謝!關於java ByteArrayOutputStream類
那麼,我怎樣才能得到真正的像素值? – 2010-11-21 05:40:46