Skip to content

Instantly share code, notes, and snippets.

@yagitoshiro
Created April 16, 2013 01:27
Show Gist options
  • Save yagitoshiro/5392658 to your computer and use it in GitHub Desktop.
Save yagitoshiro/5392658 to your computer and use it in GitHub Desktop.
キリトリ
button.addEventListener('click', function(e){
Ti.Media.openPhotoGallery({
error: function(){},
cancel: function(){},
success: function(e){
var size = Math.min(e.media.width, e.media.height) / 2;
var image = e.media.imageAsCropped({
x: 0,
y: 0,
width: size,
height: size
});
var imageView = Ti.UI.createImageView({
image: image,
top: 100
});
self.add(imageView);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment