Skip to content

Instantly share code, notes, and snippets.

@haroonabbasi
Created October 20, 2015 12:53
Show Gist options
  • Save haroonabbasi/01673fb9d946b3d80f32 to your computer and use it in GitHub Desktop.
Save haroonabbasi/01673fb9d946b3d80f32 to your computer and use it in GitHub Desktop.
Titanium: get Image Size from ImageView
image_view.addEventListener("load",getImageSize);
function getImageSize(e) {
var blob = e.source.toBlob();
if (blob === null) {
Ti.API.info("unable to get image size");
} else {
Ti.API.info("id:" + e.source.id + " size=" + blob.width + "x" + blob.height);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment