byte[] to Image

Discussion in 'Java' started by anonymous@coolgroups.com, May 27, 2004.

  1. Guest

    How do I convert a byte[] to an Image object?

    TI
    , May 27, 2004
    #1
    1. Advertising

  2. Chris Smith Guest

    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(myByteArray);

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

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, May 27, 2004
    #2
    1. Advertising

  3. SPG Guest

    Hi,

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

    HTH,

    Steve
    <> wrote in message
    news:...
    > How do I convert a byte[] to an Image object?
    >
    > TI
    SPG, May 27, 2004
    #3
  4. <> schreef in bericht
    news:...
    > 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.
    Boudewijn Dijkstra, May 27, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas
    Replies:
    1
    Views:
    829
    Jonathan Bromley
    May 4, 2004
  2. =?Utf-8?B?RGVhc3Vu?=

    Conversion issue: Image>Byte array>Image

    =?Utf-8?B?RGVhc3Vu?=, Jul 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    878
    =?Utf-8?B?RGVhc3Vu?=
    Jul 14, 2005
  3. Bharat Bhushan

    Appending byte[] to another byte[] array

    Bharat Bhushan, Aug 5, 2003, in forum: Java
    Replies:
    15
    Views:
    40,207
    Roedy Green
    Aug 5, 2003
  4. Jean-Daniel Gamache
    Replies:
    0
    Views:
    410
    Jean-Daniel Gamache
    Jul 14, 2004
  5. Peter
    Replies:
    3
    Views:
    714
    Michael Borgwardt
    Aug 5, 2004
Loading...

Share This Page