Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 678099 of CanvasPattern

  • Revision slug: Web/API/CanvasPattern
  • Revision title: CanvasPattern
  • Revision id: 678099
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("Canvas")}}

The CanvasPattern interface represents an opaque object describing a pattern, based on a image, a canvas or a video, created by the {{domxref("CanvasRenderingContext2D.createPattern()")}} method.

Properties

Representing an opaque object, there is no exposed property.

Methods

There is no inherited method.

{{domxref("CanvasPattern.setTransform()")}} {{experimental_inline}}
Applies an {{domxref("SVGMatrix")}} representing a linear transform to the pattern.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "the-canvas-element.html#canvaspattern", "CanvasPattern")}} {{Spec2('HTML WHATWG')}} Added setTransform() method.
{{SpecName('HTML Canvas 2D Context W3C', '#canvaspattern', 'CanvasPattern')}} {{Spec2('HTML Canvas 2D Context W3C')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 4.0 {{CompatGeckoDesktop("1.9.2")}} 9.0 9.0 3.1
setTransform(){{experimental_inline}} {{CompatNo}} {{CompatGeckoDesktop("33")}} {{CompatUnknown}} {{CompatNo}} {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 2.1 {{CompatGeckoMobile("1.9.2")}} {{CompatUnknown}} 10.0 3.2
setTransform(){{experimental_inline}} {{CompatUnknown}} {{CompatGeckoMobile("33")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

  • {{domxref("CanvasRenderingContext2D.createPattern()")}}
  • The {{HTMLElement("canvas")}} element and its associated interface, {{domxref("HTMLCanvasElement")}}

Revision Source

<div>
 {{APIRef("Canvas")}}</div>
<p>The <code><strong>CanvasPattern</strong></code> interface represents an opaque object describing a pattern, based on a image, a canvas or a video, created by the {{domxref("CanvasRenderingContext2D.createPattern()")}} method.</p>
<h2 id="Properties">Properties</h2>
<p><em>Representing an opaque object, there is no exposed property.</em></p>
<h2 id="Methods">Methods</h2>
<p><em>There is no inherited method.</em></p>
<dl>
 <dt>
  {{domxref("CanvasPattern.setTransform()")}} {{experimental_inline}}</dt>
 <dd>
  Applies an {{domxref("SVGMatrix")}} representing a linear transform to the pattern.</dd>
</dl>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', "the-canvas-element.html#canvaspattern", "CanvasPattern")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>Added <code>setTransform()</code> method.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML Canvas 2D Context W3C', '#canvaspattern', 'CanvasPattern')}}</td>
   <td>{{Spec2('HTML Canvas 2D Context W3C')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
 {{CompatibilityTable}}</div>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>4.0</td>
    <td>{{CompatGeckoDesktop("1.9.2")}}</td>
    <td>9.0</td>
    <td>9.0</td>
    <td>3.1</td>
   </tr>
   <tr>
    <td><code>setTransform()</code>{{experimental_inline}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatGeckoDesktop("33")}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatNo}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>2.1</td>
    <td>{{CompatGeckoMobile("1.9.2")}}</td>
    <td>{{CompatUnknown}}</td>
    <td>10.0</td>
    <td>3.2</td>
   </tr>
   <tr>
    <td><code>setTransform()</code>{{experimental_inline}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatGeckoMobile("33")}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li>{{domxref("CanvasRenderingContext2D.createPattern()")}}</li>
 <li>The {{HTMLElement("canvas")}} element and its associated interface, {{domxref("HTMLCanvasElement")}}</li>
</ul>
Revert to this revision