Android Canvas Set the processing mode for overlapping parts of painting "with effect Diagram"

Source: Internet
Author: User

The Porterduff.mode class in Android lists the rules they make:

Android.graphics.PorterDuff.Mode. SRC: Drawing only source images

Android.graphics.PorterDuff.Mode. DST: Draw only the target image

Android.graphics.PorterDuff.Mode. dst_over: Draws the target image at the top of the source image

Android.graphics.PorterDuff.Mode. dst_in: Draws the target image only where the source image and the target image intersect

Android.graphics.PorterDuff.Mode. dst_out: Draws the target image only where the source image and the target image do not intersect

Android.graphics.PorterDuff.Mode. dst_atop: Draws the target image where the source and destination images intersect, drawing the source image where it does not intersect

Android.graphics.PorterDuff.Mode. src_over: Draws the source image at the top of the target image

Android.graphics.PorterDuff.Mode. src_in: Draws the source image only where the source and destination images intersect

Android.graphics.PorterDuff.Mode. src_out: Draws the source image only where the source and destination images do not intersect

Android.graphics.PorterDuff.Mode. src_atop: Draws the source image where the source and destination images intersect, and draws the target image where it does not intersect

Android.graphics.PorterDuff.Mode. XOR: Draw them anywhere outside of the source image and target image, and do not draw any content where they do not overlap

Android.graphics.PorterDuff.Mode. lighten: Obtains the brightest pixel in two images in each position and displays

Android.graphics.PorterDuff.Mode. Darken: Obtains the darkest pixel of two images in each position and displays

Android.graphics.PorterDuff.Mode. MULTIPLY: Multiplies two pixels per location by 255, and then uses that value to create a new pixel to display. Result color = top Color * Bottom Color/255

Android.graphics.PorterDuff.Mode. screen: Invert each color, perform the same action (multiply them by 255), and then invert again. Result Color =255-(((255-top color) * (255-bottom color))/255)

Android Canvas Sets the processing mode for overlapping portions of painting "with"

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.