var win = Titanium.UI.createWindow({
backgroundColor:'#fff',
layout: 'vertical'
});
win.open();
var greenBox = Titanium.UI.createView({
backgroundColor: '#0f0',
top: 50,
left: 50,
height: 50,
width: 50
});
win.add(greenBox);
var blob = greenBox.toImage();
var boxAsImage = Titanium.UI.createImageView({
image: blob,
top: 50,
left: 50,
height: 50,
width: 50
})
win.add(boxAsImage);
var cropped = blob.imageAsCropped({
height: 10,
width: 10,
x: 10,
y: 10
});
var thumbImage = Titanium.UI.createImageView({
image: cropped,
top: 50,
left: 50
})
win.add(thumbImage);
On iOS this will display two 50px green squares with a third 10px green square underneath, while on Android, only the first two squares will be displayed (see screenshots).
master PR: https://github.com/appcelerator/titanium_mobile/pull/6907 testing code:
Verified the fix. Blob methods work as expected. Environment: Appc Studio : 4.1.0.201505071004 Ti SDK : 4.1.0.v20150614181235 Ti CLI : 4.0.1 Alloy : 1.6.2 MAC Yosemite : 10.10.3 Appc npm : 4.0.1 Appc CLI : 4.0.2 Node: v0.10.37 Android 5.0.2