HTML and CSS Reference
In-Depth Information
Name
Description
Example
The default alpha value for
all fills and strokes. Value
must be between 0 and 1.
The default is 1.0 .
globalAlpha
context.globalAlpha = .6;
globalCompositeOperation
Sets how shapes and
images are written to the
canvas. See Table 3-14 for
the various options. A is the
object being written (source)
and B is the current canvas
drawing (destination). The
default is source-over .
context.
globalCompositeOperation
= "destination-over";
T ABLE 3-13 canvas Compositing Properties
Compositing Operation Keyword
Description
Displays only A.
copy
destination-atop
Displays B where A and B overlap. Displays A where they do not
overlap. Does not display B where they do not overlap.
destination-in
Displays B only in the region that A and B overlap. No A is
displayed.
destination-out
Displays B only in the region that A and B do not overlap. No A is
displayed.
destination-over
Displays all of B and displays A where they do not overlap.
lighter
In overlapping regions, displays the sum of A and B. In
nonoverlapping regions, A and B appear normally.
Displays A where A and B overlap. Displays B where they do not
overlap. Does not display A where they do not overlap.
source-atop
Displays A only in the region that A and B overlap. No B is
displayed.
source-in
Displays A only in the region that A and B do not overlap. No B is
displayed.
source-out
Displays all of A and displays B where they do not overlap.
source-over
xor
In overlapping regions, nothing is displayed. In nonoverlapping
regions, A and B appear normally.
T ABLE 3-14 canvas Compositing Options
 
Search WWH ::




Custom Search