How can I reconstruct a image from a buffer so that I can draw that in Java Swing component?  
Author Message
faiyeah





PostPosted: 2006-4-1 1:29:00 Top

java-programmer, How can I reconstruct a image from a buffer so that I can draw that in Java Swing component? I have a byte buffer, let's say buf.

buf[20000] is now containing an JPEG image file's bytes, which has
about 10000 bytes

How can I draw that out in Java swing components like ImageIcon or
Jlabel??

Thank you.

Can anyone provide me some sample code??

Thank you/.

 
Roedy Green





PostPosted: 2006-4-1 1:52:00 Top

java-programmer >> How can I reconstruct a image from a buffer so that I can draw that in Java Swing component? On 31 Mar 2006 09:28:49 -0800, "faiyeah" <email***@***.com> wrote,
quoted or indirectly quoted someone who said :

>I have a byte buffer, let's say buf.

see http://mindprod.com/jgloss/image.html
http://mindprod.com/jgloss/imageio.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
faiyeah





PostPosted: 2006-4-1 13:54:00 Top

java-programmer >> How can I reconstruct a image from a buffer so that I can draw that in Java Swing component? I love you baby. I've got it!!
Everything solved!!!!
Thank you.
You are really the one who save my life~

 
 
Roedy Green





PostPosted: 2006-4-2 2:01:00 Top

java-programmer >> How can I reconstruct a image from a buffer so that I can draw that in Java Swing component? On 31 Mar 2006 21:54:28 -0800, "faiyeah" <email***@***.com> wrote,
quoted or indirectly quoted someone who said :

>I love you baby. I've got it!!
>Everything solved!!!!
>Thank you.
>You are really the one who save my life~

My goodness. They shoot you for failure? You work for Emperor
Palpatine?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.