Open sornanun opened 8 years ago
@sornanun The correct way to call this plugin inside your controller:
window.canvas2ImagePlugin.saveImageDataToLibrary( function(msg){ console.log(msg); //This is your successCallback, msg - here should return the local path where the image was stored }, function(err){ console.log(err); //This is your failureCallback }, document.getElementById('myCanvas') // This is your canvas id );
Don't use > cordova.exec( successCallback, failureCallback, "Canvas2ImagePlugin", "saveImageDataToLibrary", [dataURI] ); This is already defined in the plugin interface file.
@ghost, that is not the error OP was having ? Also, cordova.exec(..) using a dataURI as last argument is a working (though in this case apparently redundant) call on Android using 0.6.0
I work on ionic framework. I added canvas2ImagePlugin to my project and link it in index.html. But I have some problem that I don't know how to fix. I'm a beginner with ionic and angularJS.
Error : Canvas2ImagePlugin.js:10Uncaught ReferenceError: module is not defined
and I will use this code in my controller.js to save image to mobile storage.
I want to convert my canvas as image then save on my mobile device storage. But my issue is module is not defined. Please help. Thanks.