Image to blob

Hi all,

Currentely I’m working on a project to save data in a database along with a picture.

My first idea was to convert the image to a byte array, and safe this in the database as a BLOB.
But is this possible .?
Because I can’t find a way to convert the Image to al byte array…
(the image comes from the class CameraHandler from the function getCameraSnapshot())

Or is there a better way to store the picture data.?

Thanks in advance.


Hi Ken,

Image.getRGB can be used to retrieve the raw pixel data from any Image. If you’re looking for a recognised image format representation, you can additionally use the runtime PngParser.pngCreateByteArray method to return you a byte array which is the image encoded into the PNG file format.


(Mobile Designer Development Team)

I have used base64Encode for REST intgeration with mobile app and IS.
Was able to store in db and retrive data for any attachments and images.
Not sure from mobile designer apis same can be achieved