Thursday 15 April 2010

javascript - Graphics beginBitmapFill easeljs -


I want to show the shapes like this example:

I load images in the image Want to This is what I am doing:

  // setup this.graphics.clear (); This.graphics.beginStroke ("#FFFFFF"); This.graphics.beginBitmapFill (img); This.graphics.moveTo (0, size);   

But I get this error continuously:

UnkeyType type error: type error

In this error graphic .js: Enter image details here

Documentation:

It is very clear, you pass a string and not an image (HTMLImageElement).

Try: var img1 = new image (); Img1.src = 'image1.png';

or

  var img1 = document.createElement ('img') img2.src = 'image2.jpg';    

No comments:

Post a Comment