> I need to output a byte[] buffer from a class that has access to a
> MemoryImageSource and/or a BufferedImage. I need to be able to
> somehow convert that to a byte array to pass on to another class.
> Does anyone have an elegant way to convert from a bufferedimage (or
> MIS) to a byte array?
MemoryImageSource takes byte or int array as argument
1) if it was byte array - nothing to convert
2) convert int array to byte array is easy work
If you have BufferedImage:
3) if you have BufferedImage than use getRGB() to get int array (see p. 2)
--
http://uio.dev.java.net
http://reader.imagero.com