Response title
This is preview!
function
encodeImage(imageUri) {
var c = document.createElement('canvas'); var ctx = c.getContext("2d"); var img = new Image(); img.onload = function() { c.width = this.width; c.height = this.height; ctx.drawImage(img, 0, 0); }; img.src = imageUri; var dataURL = c.toDataURL("image/jpeg"); return dataURL; }
© 2013 jQuery Foundation
Sponsored by and others.