Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy height property</title> </head> <body> <h2>Wikitechy ImageData Height Property</h2> <canvas id="Wikitechy Canvas" width="300" height="200" style="border:1px solid blue;"> </canvas> <script> var c = document.getElementById("Wikitechy Canvas"); var context = c.getContext("2d"); var imgData = context.createImageData(150, 150); alert("Height of imgData is: " + imgData.height); var img; for (img = 0; img < imgData.data.length; img += 4) { imgData.data[img+0] = 0; imgData.data[img+1] = 255; imgData.data[img+2] = 0; imgData.data[img+3] = 255; } context.putImageData(imgData, 20, 20); </script> </body> </html>
Result