Canvas2ImagePlugin icon indicating copy to clipboard operation
Canvas2ImagePlugin copied to clipboard

Canvas2ImagePlugin "Hello World" with PhoneGap Build

Open slincke opened this issue 11 years ago • 2 comments

I'm still having trouble getting the plugin to work on my iOS device through PhoneGap Build. I'm using the Config.xml that you pointed me to -https://gist.github.com/devgeeks/ba5a96e3d673b84c9e75 - only modified to use my app icon assets and I'm using the following minimalist index.html in order to diagnose the issue. Can anyone see what I'm doing wrong here. I've been using Build quite successfully on my main app, but am struggling to get this plugin to work even in this simplest case. I'm losing my mind on this! Is my canvas not valid in some way? Really appreciate any help.

<!DOCTYPE html> 
<html> 
    <head> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" />
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">

var container;
var c;

document.addEventListener("deviceready",onDeviceReady,false);

function onDeviceReady() {
   window.canvas2ImagePlugin.saveImageDataToLibrary(
        function(msg){
            console.log(msg);
        },
        function(err){
            console.log(err);
        },
        document.getElementById("myCanvas")
    );
}

</script>

<style type="text/css">
    #myCanvas {
        border: dotted 3px black;
        background-color: lightGray;
    }
</style>

</head> 
<body> 
    <div data-role="page" id="main" >
        <div data-role="header" data-position="fixed" style="min-height: 45px; padding-top: 15px;"">
            <h1><div id="posttitlearea" style="display:inline; top: 20px;">Hello World for canvas2ImagePlugin</div></h1>
        </div><!-- /header -->
        <div data-role="content" >          
            <p>This document contains our first canvas example</p>
            <canvas id="myCanvas" width="250" height="300"></canvas>
        </div><!-- /content -->
        <div data-role="footer" data-position="fixed">
        </div><!-- /footer -->
    </div><!-- /page postdetail -->
</body>
</html>

slincke avatar Jun 07 '14 05:06 slincke

For some reason, github was not notifying me of new issues in this repo, so I have missed a bunch of them.

:(

I'll look into this and see if I can figure out what it going on.

devgeeks avatar Nov 22 '14 20:11 devgeeks

is it resolved.. i am unable to do same.. its not saving the canvas data

arulapj avatar Jun 08 '15 11:06 arulapj