You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Manuel Augusto (JIRA)" <ji...@apache.org> on 2016/03/01 07:52:18 UTC

[jira] [Created] (CB-10742) putImageData doesn't work after a drawImage on Canvas

Manuel Augusto created CB-10742:
-----------------------------------

             Summary: putImageData doesn't work after a drawImage on Canvas
                 Key: CB-10742
                 URL: https://issues.apache.org/jira/browse/CB-10742
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin WKWebViewEngine
            Reporter: Manuel Augusto


Full code that can be tested on this url: http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_canvas_tut_img

<!DOCTYPE html>
<html>
<body>

<p>Image to use:</p>
<img id="scream" src="img_the_scream.jpg" alt="The Scream" width="220" height="277">

<p>Canvas to fill:</p>
<canvas id="myCanvas" width="250" height="300"
style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>

<p><button onclick="myCanvas()">Try it</button></p>

<script>
function myCanvas() {
    var c = document.getElementById("myCanvas");
    var ctx = c.getContext("2d");
    var img = document.getElementById("scream");
    ctx.drawImage(img,10,10);

ctx.fillStyle = "red";
ctx.fillRect(10, 10, 50, 50);
var imgData = ctx.getImageData(10, 10, 50, 50);
ctx.putImageData(imgData, 10, 70);

}
</script>

</body>
</html>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org