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: [email protected]
For additional commands, e-mail: [email protected]