Re: how to use a byte array to create image
- From: "Qu0ll" <Qu0llSixFour@xxxxxxxxx>
- Date: Thu, 26 Jun 2008 19:49:00 +1000
"Knute Johnson" <nospam@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:4862688e$0$4084$b9f67a60@xxxxxxxxxxxxxxxxxxxxx
jimgardener wrote:
[...]
If what you have is truly 'image data' in the Java sense then creating the image from a byte array is done by converting the bytes to an int[] and setting the data of the BufferedImage with setRGB(). From there use ImageIO to write out your TIFF file.
If the 'image data' is an array of bytes read from some file then I would have to know what sort of file to tell you how to proceed.
I too am interested in this. I have some JPEG files from which I need to create images suitable for transmission across a network and I note that BufferedImage does not implement Serializable. I can read the contents from the file as a byte array and transmit that array but how do I turn the array into some form of image to be displayed on a screen at the other end?
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@xxxxxxxxx
[Replace the "SixFour" with numbers to email me]
.
- Follow-Ups:
- Re: how to use a byte array to create image
- From: Andrew Thompson
- Re: how to use a byte array to create image
- References:
- how to use a byte array to create image
- From: jimgardener
- Re: how to use a byte array to create image
- From: Knute Johnson
- how to use a byte array to create image
- Prev by Date: Re: Animated GIF display in JFrame vs. JApplet
- Next by Date: CryptoUtil code from Jason weiss book
- Previous by thread: Re: how to use a byte array to create image
- Next by thread: Re: how to use a byte array to create image
- Index(es):
Relevant Pages
|