var intent = new Intent(Intent.EDIT, ‘image/png’, getImageDataURI());

window.navigator.startActivity(intent, loadEditedImage);



// This callback will be called when the service replies with the edited

// image data.

function loadEditedImage(data) {

var image = document.getElementById(‘image’);

setImageData(image, data);

}



<intent

action=”http://webintents.org/edit”

type=”image/*”

/>

var intent = window.intent;

memeImg.src = intent.data;



memegenForm.onsubmit = function() {

// Transform the image - meme it.

addMemeTaglines(memeImg, memeTopText, memeBottomText);



// Send the generated meme back to the client.

intent.postResult(getImageData(memeImg));

};

postResult()

startActivity()

Posted by James Hawkins, Software Engineer