Canvas2ImagePlugin icon indicating copy to clipboard operation
Canvas2ImagePlugin copied to clipboard

Canvas2Image Plugin

Open mario-aleo opened this issue 9 years ago • 3 comments

Hello,

I need some help here, I'm using phonegap with angular.js, but i can't get you plugin work with angular. I've installed the plugin by cordova add plugin, on the onDeviceReady it's been called by:

var canvas2ImagePlugin = window.plugins.canvas2ImagePlugin;

and also I'm defining it on my controller as:

$scope.save = function(){
        var cnv = document.getElementById('pwMainCanvas');

        canvas2ImagePlugin.saveImageDataToLibrary(
            function(msg){
                console.log(msg);
            }, 
            function(err){
                console.log(err);
            }, 
            'pwMainCanvas'  /*or cnv, or pwMainCanvas*/
        );
};

Someone already had made it or know what I'm doing wrong?

Thanks.

mario-aleo avatar Sep 17 '15 20:09 mario-aleo

What is defining window.plugins?

I'm guessing if you follow the example code, it will work.

window.canvas2ImagePlugin.saveImageDataToLibrary(...)

positlabs avatar Oct 12 '15 23:10 positlabs

Actually...

I'm using cordova 5.3.3 for Android, and window.canvas2ImagePlugin is not defined on window. It seemed to be working until I updated cordova from 4.x

positlabs avatar Oct 13 '15 00:10 positlabs

Yes, I'm starting to think that the new Cordova is a problem with this plugin.

ghost avatar Nov 30 '15 21:11 ghost