How to modify sprite pixels

Using the iphone framework I was able to modify the pixels of a sprite but with the HTML5 framework I cannot figure out how to do it. Can anyone help please ?
Thank you
Claudio

Hi Claudio,

CanvasRenderingContext2D has three functions to modify the pixels of a canvas:

  1. CanvasRenderingContext2D.prototype.getImageData = function(sx,sy,sw,sh) {};
  2. CanvasRenderingContext2D.prototype.putImageData = function(image_data,dx,dy,dirtyX,dirtyY,dirtyWidth,dirtyHeight) {};
  3. CanvasRenderingContext2D.prototype.createImageData = function(imagedata_or_sw,sh) {};

Best regards
David

Sounds good. Thank you. But sorry. How to use it with a cc.Sprite object ?