我需要将 TiBlob 图像对象转换为字符串。我尝试了以下方法。但没有成功。
var imageFile = Titanium.Filesystem.getFile('images8.png');
var oneImage = imageFile.read();
var image = oneImage;
var tempFile = Titanium.Filesystem.createTempFile();
tempFile.write(oneImage);
var contents = tempFile.read();
var x = Ti.Utils.base64decode(contents);
alert('type of x is '+typeof(x)); //Object
alert('type of x is '+x.text); //null
alert(JSON.stringify(oneImage)); //output is null
alert('value of image is '+image); //TiBlob Object
alert(typeof(contents.toString())); //String
alert('value of image after conversion is '+contents.toString()); //null
alert('value of text image is '+typeof(contents.text)); //String
alert('value of image after conversion text is '+contents.text); //null
提前致谢...........