generated at
CanvasAPI:パターン
パターンオブジェクト
CanvasPatternオブジェクト

createPattern(image, type)
新しいキャンバスパターンオブジェクトを作成し、返します。
image は CanvasImageSource です(つまり、HTMLImageElement、他のキャンバス、 <video> 要素などです)。
type は、画像の利用方法を示す文字列です。

js
var img = new Image(); img.src = "someimage.png"; var ptrn = ctx.createPattern(img, "repeat");