Question

I'm trying to draw a circle that is filled with a bitmap, but I'm receiving the following error:

Failed to execute 'createPattern' on 'CanvasRenderingContext2D': No function was found that matched the signature provided.

code:

var bitmap = new createjs.Bitmap(picture);
var circle = new createjs.Shape();
circle.graphics.clear().beginBitmapFill(bitmap, "no-repeat",this.getCanvasContainer().getMatrix())
       .beginStroke("yellow").drawCircle(0,0,50);
       this.getCanvasContainer().addChild(circle); 
Was it helpful?

Solution

I solved the problem in the following way:

var image = new Image();
image.src = source;
circle.graphics.beginBitmapFill(image, "no-repeat").drawCircle(0,0,25);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top