Skip to content

Instantly share code, notes, and snippets.

@hal-gh
Forked from anonymous/gist:667756
Created November 8, 2010 15:18
Show Gist options
  • Save hal-gh/667799 to your computer and use it in GitHub Desktop.
Save hal-gh/667799 to your computer and use it in GitHub Desktop.
var imageScrollView = Titanium.UI.createScrollView({
contentWidth:'auto',
contentHeight:'auto',
top:0,
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:true
});
var select;
var category;
var picture = '';
postPhoto.addEventListener('click',function(e){
Titanium.Media.openPhotoGallery({
success:function(event){
var saveImageView = Titanium.UI.createImageView({
top: 10,
left: 10,
width: '300',
height: '220',
canScale: true,
image: event.media,
});
imageScrollView.add(saveImageView);
picture = saveImageView.toBlob();
win1.add(saveImageView);
},
cancel:function(){
Titanium.API.info('Photo Gallery cancel');
},
error:function(error){
Titanium.API.info('Photo Gallery error');
},
allowImageEditing:true
});
win1.add(imageScrollView);
});
win1.add(postPhoto);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment