<canvas>
are available through this interface, returned by a call to getContext()
on the <canvas>
element, with "2d" as its argument.#000
(black).10px sans-serif
.1.0
(opaque).globalAplpha
applied this sets how shapes and images are drawn onto the existing bitmap. Possible values: source-atop
source-in
source-out
source-over
(default)destination-atop
destination-in
destination-out
destination-over
lighter
xor
butt
(default), round
, square
round
, bevel
, miter
(default)1.0
10
.0
#000
(black).start
(default), end
, left
, right
or center
.A new DOM canvas pattern object for use in pattern-based operations.
NS_ERROR_DOM_INVALID_STATE_ERR
Requires Gecko 10.0
<canvas>
element for the image
parameter is zero-sized (that is, one or both of its dimensions are 0 pixels).Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.
image
<img>
, <canvas>
, and <video>
). Some browsers, including Firefox, let you use any arbitrary element.dx
image
.dy
image
.dw
image
in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.dh
image
in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.sx
sy
sw
sx
and sy
to the bottom-right corner of the image is used. If you specify a negative value, the image is flipped horizontally when drawn.sh
The diagram below illustrates the meanings of the various parameters.
INDEX_SIZE_ERR
INVALID_STATE_ERR
TYPE_MISMATCH_ERR
sw
and sh
was added in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)
.