Resizing an Image
Hi,
I'm trying to take an image, resize it and store it in an array, but my app keeps force-closing. Can anyone spot where I'm going wrong?
Cheers,
Mark
var image = []
var win = Ti.UI.createWindow({ backgroundColor: 'white' })
var imageView = Ti.UI.createImageView({
top:20,
width:100,
height:100,
backgroundColor: 'blue'
})
var button = Ti.UI.createButton({
title:"Take",
top:200
})
button.addEventListener('click', function () {
Ti.Media.showCamera({
success: function(e) {
var temp = Ti.UI.createImageView ({
backgroundImage: e.media,
width:100,
height:100
})
image[image.length]=temp.toImage();
imageView.image=image[image.length-1]
}
})
})
win.add(imageView)
win.add(button)
win.open();
1 Answer
-
Accepted Answer
If you are testing this in Android it will not work. I believe they messed up the ImageView for Android and you can't re-size images. It will be fixed in Release 1.5.0 I believe.