Evangelism/Firefox3.5/35Days/Articles/createImageData: Difference between revisions

Jump to navigation Jump to search
Line 98: Line 98:
   
   
     // Index of the pixel in the array
     // Index of the pixel in the array
     var idx = (x + y * width) * 4;
     var idx = (x + y * canvas.width) * 4;
   
   
     // The RGB values
     // The RGB values
Line 112: Line 112:
   }
   }
  }
  }
  canvas.putImageData(canvasData, 0, 0);
  ctx.putImageData(canvasData, 0, 0);
 
See in action http://people.mozilla.com/~prouget/demos/35days/gray.xhtml


==== createImageData ====
==== createImageData ====
Confirmed users
591

edits

Navigation menu