HTML 5 canvas, HTML 5 canvas

Source: Internet
Author: User

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> 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.