CanvasPattern

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Canvas API")}}{{AvailableInWorkers}}

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

It can be used as a {{domxref("CanvasRenderingContext2D.fillStyle", "fillStyle")}} or {{domxref("CanvasRenderingContext2D.strokeStyle", "strokeStyle")}}.

Instance properties

_As an opaque object, this has no exposed property._

Instance methods

_There are no inherited method._

  • {{domxref("CanvasPattern.setTransform()")}}
  • : Applies a {{domxref("DOMMatrix")}} representing a linear transform to the pattern.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

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