我正在尝试绘制一个填充了位图的圆圈,但我收到以下错误:
Failed to execute 'createPattern' on 'CanvasRenderingContext2D': No function was found that matched the signature provided.
代码:
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);
答案 0 :(得分:1)
我通过以下方式解决了问题:
var image = new Image();
image.src = source;
circle.graphics.beginBitmapFill(image, "no-repeat").drawCircle(0,0,25);