The CanvasPattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method.
It can be used as a fillStyle or strokeStyle.
Properties
As an opaque object, this has no exposed property.
Methods
There are no inherited method.
CanvasPattern.setTransform()- Applies an
SVGMatrixrepresenting a linear transform to the pattern.
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of 'CanvasPattern' in that specification. |
Living Standard | Added setTransform() method in v5. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CanvasPattern | Chrome Full support 4 | Edge ? | Firefox Full support 3.6 | IE Full support 9 | Opera Full support 9 | Safari Full support 3.1 | WebView Android ? | Chrome Android Full support 18 | Edge Mobile ? | Firefox Android Full support 4 | Opera Android Full support 10.0 | Safari iOS Full support 3.2 | Samsung Internet Android Full support Yes |
setTransform | Chrome Full support 68 | Edge No support No | Firefox Full support 33 | IE No support No | Opera Full support 9 | Safari Full support 3.1 | WebView Android Full support 68 | Chrome Android Full support 68 | Edge Mobile No support No | Firefox Android Full support 33 | Opera Android Full support 9 | Safari iOS Full support 11 | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
See also
CanvasRenderingContext2D.createPattern()- The
<canvas>element and its associated interface,HTMLCanvasElement
Document Tags and Contributors
Tags:
Contributors to this page:
mdnwebdocs-bot,
jpmedley,
mfluehr,
1j01,
fscholz,
Acorath,
teoli,
tschneidereit,
kscarfone,
ethertank,
Sheppy,
Brettz9
Last updated by:
mdnwebdocs-bot,

