HTML 5 canvas, HTML 5 canvas
Source-over |
Default value. Displays the source image on the target image. |
Source-atop |
The source image is displayed at the top of the target image. The source image is invisible outside the target image. |
Source-in |
Displays the source image in the target image. Only the source image in the target image is displayed, and the target image is transparent. |
Source-out |
Displays the source image outside the target image. Only the part of the source image outside the target image is displayed. The target image is transparent. |
Destination-over |
The target image is displayed above the source image. |
Destination-atop |
The target image is displayed at the top of the source image. The part of the target image outside the source image is not displayed. |
Destination-in |
Displays the target image in the source image. Only the target image in the source image is displayed, and the source image is transparent. |
Destination-out |
Displays the target image outside the source image. Only the target image outside the source image is displayed, and the source image is transparent. |
Lighter |
Displays the source image + target image. |
Copy |
Displays the source image. Ignore the target image. |
Source-over |
Use an exclusive or operation to combine the source image and the target image. |
The above is the attribute of HTML 5 canvas globalCompositeOperation.
<! DOCTYPE html> <body> <canvas id = "myCanvas" width = "300" height = "150"> <! DOCTYPE html> <body> <canvas id = "myCanvas" width = "300" height = "150"> practice can be improved<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <meta http-equiv =" Content-Type "content =" text/html; charset = UTF-8 "/> <title> canvas synthesis </title> <script src =" js/modernizr. js "> </script>