angular-canvas-ext
angular-canvas-ext copied to clipboard
load a image
Hello, how can I load a image with an url link and not a input file button ?
I wrote : < body onload="init()"; >
then...
function init(){ console.debug("go init"); var ctx = document.getElementById('in').getContext('2d'); var imageObj = new Image(); imageObj.src = 'http://www.xxx.com/careers.jpg'; ctx.drawImage(imageObj,1, 0);
But zoomIn / zoomOut & crop are not displayed. With CSS, I can display them, but I have an error :
TypeError: canvasData is null $scope.crop()main_co...ller.js (ligne 28) Ya.prototype.functionCall/<()angular.min.js (ligne 166) Pc[c]</<.compile/</</<()angular.min.js (ligne 183) Ed/this.$get</h.prototype.$eval()angular.min.js (ligne 104) Ed/this.$get</h.prototype.$apply()angular.min.js (ligne 105) Pc[c]</<.compile/</<()angular.min.js (ligne 183) $c/c/<()angular.min.js (ligne 27) r()angular.min.js (ligne 7) $c/c()angular.min.js (ligne 27)
$scope.rightCanvas.src = canvasData.dataURI;
Thanks you for your reply