Advertisement
Guest User

Untitled

a guest
Jul 19th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // resize the imageview blob, width and height have to be explicitly set
  2. function getResizedBlob(_blob)
  3. {
  4.     return _blob.imageAsResized(165, 100);
  5. }
  6.  
  7. // create the window
  8. var win = Ti.UI.createWindow({
  9.     backgroundColor : '#fff'
  10. });
  11.  
  12. // create the initial imageview
  13. var image = Ti.UI.createImageView({
  14.     image : 'image165.jpg',
  15.     left : 0,
  16.     top : 0,
  17.     width : 165,
  18.     height : Ti.UI.SIZE,
  19.     backgroundColor : 'red'
  20. });
  21.  
  22. // pass in the resized image into the imageview
  23. image.image = getResizedBlob(image.toBlob());
  24.  
  25. win.add(image);
  26. win.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement