#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    5
    Rep Power
    0

    Post How to convert a Byte array to image


    Hi,
    Can you please provide the java code for conveting a Byte array to image.I am having a Byte array i have to convert and make to image format jpg/ and even text format.....please help

    Thanking You.
  2. #2
  3. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    Originally Posted by perlWhite
    Hi,
    Can you please provide the java code for conveting a Byte array to image.I am having a Byte array i have to convert and make to image format jpg/ and even text format.....please help

    Thanking You.
    If you have a byte array that represents an image, you can use the class java.awt.Toolkit to create it.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    5
    Rep Power
    0

    Post


    Originally Posted by bullet
    If you have a byte array that represents an image, you can use the class java.awt.Toolkit to create it.
    Hi bullet,
    Thank you for reply, i Shall be more clear in my question...What i recieve is Byte array, This Byte array was created by converting a image to a Byte array and i recieve this Byte array from the server and i need to convert the Byte array into Image format...Can please tell or guide me regarding this....Thanking You
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    5
    Rep Power
    0
    Originally Posted by bullet
    If you have a byte array that represents an image, you can use the class java.awt.Toolkit to create it.
    Bullet u said me to use Awt toolkit apart from this is there any other way is awt tool kit belongs to applets..........i dont want to use applet.....
  8. #5
  9. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    Originally Posted by perlWhite
    Bullet u said me to use Awt toolkit apart from this is there any other way is awt tool kit belongs to applets..........i dont want to use applet.....
    The Toolkit doesn't have to be used within an applet.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    5
    Rep Power
    0
    Originally Posted by bullet
    The Toolkit doesn't have to be used within an applet.
    Can you please provide me the code, so that i can understand more clearly....i am new to jave programming and AWT tool Kit i dont know regarding this.

    Thanking You for reply...
  12. #7
  13. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    Originally Posted by perlWhite
    Can you please provide me the code, so that i can understand more clearly....i am new to jave programming and AWT tool Kit i dont know regarding this.

    Thanking You for reply...
    There is a method called createImage in Toolkit that accepts a byte array.

    You can get an instance of a Toolkit with the getDefaultToolkit() method.

IMN logo majestic logo threadwatch logo seochat tools logo