Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Created November 3, 2015 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansemannn/b48c3f1515505960eeec to your computer and use it in GitHub Desktop.
Save hansemannn/b48c3f1515505960eeec to your computer and use it in GitHub Desktop.
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