将Java image对象转换成PNG格式字节数组 |
| 作者:不详 来源:本站整理 发布时间:2005-11-29 13:01:15 |
|
c.update("IDAT".getBytes()); bytePos = writeBytes( compressedLines, nCompressed, bytePos ); crc.update( compressedLines, 0, nCompressed ); crcValue = crc.getValue(); bytePos = writeInt4( (int) crcValue, bytePos ); scrunch.finish(); return true; } catch (IOException e) { System.err.println( e.toString()); return false; } } /** * Write a PNG "IEND" chunk into the pngBytes array. */ protected void writeEnd() { bytePos = writeInt4( 0, bytePos ); bytePos = writeString( "IEND", bytePos ); crc.reset(); crc.update("IEND".getBytes()); crcValue = crc.getValue(); bytePos = writeInt4( (int) crcValue, bytePos ); } } |
| [] [返回上一页] [打 印] |
|
文章评论 |
