使用位图填充圆圈的画架不起作用

时间:2014-03-07 10:07:30

标签: bitmap draw easeljs

我正在尝试绘制一个填充了位图的圆圈,但我收到以下错误:

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); 

1 个答案:

答案 0 :(得分:1)

我通过以下方式解决了问题:

var image = new Image();
image.src = source;
circle.graphics.beginBitmapFill(image, "no-repeat").drawCircle(0,0,25);
相关问题