Canvas Tutorials

Canvas Methods and Properties

HTML canvas createPattern() Method

HTML canvas createPattern() Method



The createPattern() method repeats specified elements in a specified direction. The element can be an image, video, or another canvas element.




Its syntaxt is :- context.createPattern(image,repeat | repeat-x | repeat-y | no-repeat);


Further Explanation:-


Parameter Description
image Specifies the image, canvas, or video element of the pattern to use
repeat Default. The pattern repeats both horizontally and vertically
repeat-x The pattern repeats only horizontally
repeat-y The pattern repeats only vertically
no-repeat The pattern will be displayed only once and no repeat.

Code Explanation

All Tutorials related to Canvas Methods and Properties

All Sections related to Canvas