You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Marco Castillo <ma...@gmail.com> on 2012/01/23 20:03:03 UTC

How to insert an image using Image class

Dear List:
I have an image stored as it Base64 representation. I can convert the image
back to an array of bytes. How can I embedded such an Image in an ImageView
object from Pivot? I need this because I'm developing a shoping cart using
Pivot, and I need to present the Image of each product. Please any
suggestion would be welcome.

Thanks in advance for your help.

Regards

Marco

SV: How to insert an image using Image class

Posted by Edvin Syse <es...@syse.no>.
I have an image stored as it Base64 representation. I can convert the image back to an array of bytes. How can I embedded such an Image in an ImageView object from Pivot? I need this because I'm developing a shoping cart using Pivot, and I need to present the Image of each product. Please any suggestion would be welcome.


You can load it like this:

imageView.setImage(new Picture(ImageIO.read(new ByteArrayInputStream(imageData))));

.. where imageData is a byteArray.

-- Edvin