[whatwg] CanvasPattern::CreatePattern - Optional Arguments

Joebert mr.joebert at gmail.com
Mon Dec 5 16:19:03 PST 2005

6.1.1. The 2D context
interface CanvasRenderingContext2D
CanvasPattern createPattern(in HTMLImageElement image, DOMString
CanvasPattern createPattern(in HTMLCanvasElement image, DOMString

I would like to see optional source x (sx), source y (sy), source width
(sw), source height (sh) arguments added to the "createPattern" method.
CanvasPattern createPattern(in HTMLImageElement image, DOMString repetition,
in float sx, in float sy, in float sw, in float sh);

As of now, if a pattern needs to be created from a section of an image
consisting of multiple pattern sections,
one needs to create a temp/clip canvas where "drawImage" can extract the
then pass the temp/clip canvas to the "createPattern" method.

The optional arguments (sx, sy, sw, sh) would streamline pattern creations
of this nature.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20051205/81bac7d9/attachment-0001.htm>

More information about the whatwg mailing list