devgeeks/Canvas2ImagePlugin

Saved Image always black

joshbatchelor opened this issue · 3 comments

Fresh Cordova 3.0 project. Only plugin installed and the image that is saved is just solid black. Any ideas?

        function onDeviceReady()
        {
            window.canvas2ImagePlugin.saveImageDataToLibrary(
                function(msg){
                    console.log(msg);
                },
                function(err){
                    console.log(err);
                },
                document.getElementById('myCanvas')
            ); 
        }
        document.addEventListener('deviceready', this.onDeviceReady, false);

Did you put anything in the canvas?

An empty canvas will save as a black image.

Try something like this perhaps?

#19 (comment)

Thanks devgeeks and sorry. It was firing before everything loaded, doh!

Ah, yes. Glad you worked it out.