Copy NodeElement Image Data to a new Sprite



I’m getting stucked when tring to make a new Sprite with NodeElement Image Data

Anyone knows if there exist something like:

`var sprite = new cc.Sprite(layer.getImageData())`



I Made it!
You can take a picture to the canvas DOM element!

var photo ="image/png");
cc.loader.loadImg(photo, {isCrossOrigin : false },
  function(err, img){
    // you can use img var to make the sprite