Image based on base64 in titanium appcelerator view

base64, titanium, titanium-alloy

Solution

do this to convert the blob to a string before saving it

var stringToSaveInDatabase = Ti.Utils.base64encode(thumbBlob).toString();

when you are ready to add it to a view, do this

var imageBlob = Ti.Utils.base64decode(stringRetrievedFromDatabase);
Ti.UI.createImageView({ image:imageBlob });

http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Utils-method-base64encode

Problem

I want to put an image from SQLite but the code below does't work: ``` var imageView = Ti.UI.createImageView({ image:services.fieldByName('image') }); ```

Original source