Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > byte[] to Image

Reply
Thread Tools

byte[] to Image

 
 
anonymous@coolgroups.com
Guest
Posts: n/a
 
      05-27-2004
How do I convert a byte[] to an Image object?

TI
 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      05-27-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> How do I convert a byte[] to an Image object?
>


If it's in a format that is implemented by the default toolkit
implementation, then you call:

Toolkit.getDefaultToolkit().createImage(myByteArra y);

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
 
 
 
SPG
Guest
Posts: n/a
 
      05-27-2004
Hi,

You could use the ImageIcon implementation, which takes a byte[] as a
contructor param.
Failing that use an ImageInputStream

HTH,

Steve
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> How do I convert a byte[] to an Image object?
>
> TI



 
Reply With Quote
 
Boudewijn Dijkstra
Guest
Posts: n/a
 
      05-27-2004
<(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) om...
> How do I convert a byte[] to an Image object?


Use a java.awt.image.BufferedImage. The simplest would be to call
setRGB(int, int, int) on a newly created BufferedImage for every pixel in
the array.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wx.Image: Couldn't add an image to the image list. Laszlo Zsolt Nagy Python 1 01-26-2005 09:55 PM
Does WebControls.Image actually contain an image? Jim Hammond ASP .Net 1 11-13-2003 01:20 AM
Image can't hold an image? Gary B ASP .Net 3 08-01-2003 01:31 AM
How To Browse for an image file and save it to image server folder Mike John ASP .Net 0 07-28-2003 04:55 PM
Streaming Image data to an image viewer Jerry J ASP .Net 0 07-18-2003 01:33 PM



Advertisments