wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes BufferedImage from byte[] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "BufferedImage from byte[]" Watch "BufferedImage from byte[]" New topic
Author

BufferedImage from byte[]

sanket karkare
Greenhorn

Joined: Jan 12, 2009
Posts: 10
I have a byte array.
How can I construct a BufferedImage object.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
You could use one of the BufferedImage constructors, then call its getWriteableRaster method, and then use one of its setPixel methods appropriately.

Do you know how the bytes are arranged in the byte[]? Meaning, in which order the Red, Green, Blue and transparency values are arranged (assuming it has those), and the width and height of the image?


Ping & DNS - my free Android networking tools app
sanket karkare
Greenhorn

Joined: Jan 12, 2009
Posts: 10
Thanks, problem solved
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BufferedImage from byte[]
 
Similar Threads
byte[] to BufferedImage
getblob from db, then convert to byte and write to bitmap/jpeg
how to create an image through bufferedimage,image and other helper class using byte array
BufferedImage to File Object
problem with ImageIO.read