## CreatePattern(*[HTMLImageElement](../../../aspose.html/htmlimageelement/), string*) {#createpattern_1}

Creates a pattern using the specified image (a CanvasImageSource). It repeats the source in the directions specified by the repetition argument.

```csharp
public ICanvasPattern CreatePattern(HTMLImageElement image, string repetition)
```

| Parameter | Type | Description |
| --- | --- | --- |
| image | HTMLImageElement | A HTMLImageElement to be used as the image to repeat |
| repetition | String | A string indicating how to repeat the image. |

### Return Value

An opaque object describing a pattern.

### See Also

* interface [ICanvasPattern](../../icanvaspattern/)
* class [HTMLImageElement](../../../aspose.html/htmlimageelement/)
* interface [ICanvasRenderingContext2D](../)
* namespace [Aspose.Html.Dom.Canvas](../../../aspose.html.dom.canvas/)
* assembly [Aspose.HTML](../../../)

---

## CreatePattern(*[HTMLCanvasElement](../../../aspose.html/htmlcanvaselement/), string*) {#createpattern}

Creates a pattern using the specified image (a CanvasImageSource). It repeats the source in the directions specified by the repetition argument.

```csharp
public ICanvasPattern CreatePattern(HTMLCanvasElement image, string repetition)
```

| Parameter | Type | Description |
| --- | --- | --- |
| image | HTMLCanvasElement | A HTMLCanvasElement to be used as the image to repeat |
| repetition | String | A string indicating how to repeat the image. |

### Return Value

An opaque object describing a pattern.

### See Also

* interface [ICanvasPattern](../../icanvaspattern/)
* class [HTMLCanvasElement](../../../aspose.html/htmlcanvaselement/)
* interface [ICanvasRenderingContext2D](../)
* namespace [Aspose.Html.Dom.Canvas](../../../aspose.html.dom.canvas/)
* assembly [Aspose.HTML](../../../)
