CanvasContext.createPattern(string image, string repetition)

    string repetition

    示例代码