
## create_pattern {#aspose.html.HTMLImageElement-str}

Creates a pattern using the specified image (a CanvasImageSource). 
It repeats the source in the directions specified by the repetition argument.


### Returns 


An opaque object describing a pattern.


```python
def create_pattern(self, image, repetition):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| image | [`HTMLImageElement`](/html/python-net/aspose.html/htmlimageelement) | A HTMLImageElement to be used as the image to repeat |
| repetition | str | A string indicating how to repeat the image. |


## create_pattern {#aspose.html.HTMLCanvasElement-str}

Creates a pattern using the specified image (a CanvasImageSource). 
It repeats the source in the directions specified by the repetition argument.


### Returns 


An opaque object describing a pattern.


```python
def create_pattern(self, image, repetition):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| image | [`HTMLCanvasElement`](/html/python-net/aspose.html/htmlcanvaselement) | A HTMLCanvasElement to be used as the image to repeat |
| repetition | str | A string indicating how to repeat the image. |



### See Also
* module [`aspose.html.dom.canvas`](../../)
* class [`ICanvasRenderingContext2D`](/html/python-net/aspose.html.dom.canvas/icanvasrenderingcontext2d)
