Created
November 3, 2015 06:19
-
-
Save hansemannn/b48c3f1515505960eeec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TiCropImageEditor = require('it.etnatraining.TiCIE'); | |
var imageEditor = TiCropImageEditor.createImageEditor(); | |
imageEditor.addEventListener("done", function(e) { | |
Ti.API.warn(e); | |
alert(e.image); | |
}); | |
var win = Ti.UI.createWindow({ | |
backgroundColor : "#fff" | |
}); | |
var btn = Ti.UI.createButton({ | |
title : "Crop image", | |
width: 200, | |
height: 200, | |
backgroundColor: "#f00" | |
}); | |
btn.addEventListener("click", function() { | |
imageEditor.open(btn.toImage(), { | |
animated: true, | |
modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET | |
}); | |
}); | |
win.add(btn); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment