HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Canvas Object : "
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
createPattern() | 4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
The createPattern() method repeats the specified element in the specified direction.
The element can be an image, video, or another <canvas> element.
The repeated element can be used to draw/fill rectangles, circles, lines etc.
JavaScript syntax: | context.createPattern(image, "repeat|repeat-x|repeat-y|no-repeat"); |
---|
Parameter | Description | Play it |
---|---|---|
image | Specifies the image, canvas, or video element of the pattern to use | |
repeat | Default. The pattern repeats both horizontally and vertically | Play it » |
repeat-x | The pattern repeats only horizontally | Play it » |
repeat-y | The pattern repeats only vertically | Play it » |
no-repeat | The pattern will be displayed only once (no repeat) | Play it » |
❮ Canvas Object