Android Canvas Clip parameter explanation

Source: Internet
Author: User

When Android operates a canvas, several areas can be manipulated (including with, or, not, XOR, and so on), and the sample code is as follows

            Canvas.save ();            Canvas.translate (ten, 310);            Canvas.cliprect (0, 0,.);            Canvas.cliprect (Max, Max, N, Region.Op.XOR);   The second rect is the XOR of the first rect.            drawscene (canvas);            Canvas.restore ();



The last parameter has several choices, namely:

1 Normal No clip

2 difference based on the area of the first time, the part that differs from the second time is shown

3 REPLACE shows the second time

4 UNION Show All

5 XOR complement set (complete minus intersection) section shows

6 reverse_difference based on the second area, show the parts that are different from the first

7 INTERSECT Intersection display



Source Reference Apidemo (19)

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.